Commit Graph

171 Commits

Author SHA1 Message Date
Abdullah Atta
e53cc648f0 core: do not unsub all once events on publish
this was a stupid bug where publishing any type of event would
unsubscribe all events that had once set to true.
2023-02-28 12:11:13 +05:00
Abdullah Atta
9116a24392 global: update license year to 2023 2023-01-16 13:48:28 +05:00
Ammar Ahmed
05cd7e5002 core: add proper styling to pdf & html exports (#1579)
* mobile: fix exported pdf styling

* core: move html template styles to core

* core: inline prism-dracula styles

Signed-off-by: Abdullah Atta <abdullahatta@streetwriters.co>
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-01-06 17:58:33 +05:00
ammarahm-ed
b77254a045 mobile: configurable snooze time 2023-01-05 22:01:01 +05:00
Abdullah Atta
631142f852 core: group reminders by active/inactive 2023-01-05 22:01:01 +05:00
Ammar Ahmed
5445ee0335 core: handle crash when sorting if item doesn't have a title (#1447) 2022-12-05 10:54:55 +05:00
Abdullah Atta
222fc00bd7 core: update export templates 2022-11-23 16:22:04 +05:00
Abdullah Atta
5e6caa7273 core: use upstream htmlparser2 instead of in-house
This is mostly because I am not 100% certain about how stable our own
optimized version is. While it does perform a lot better, there is
significant risk that things might break in production. To avoid
that, I am replacing it with the upstream version which is much more
heavily tested.
2022-11-23 14:58:34 +05:00
Abdullah Atta
b1f5ffc2ec core: add dateModified comparator 2022-11-23 12:33:35 +05:00
Muhammad Ali
82b584b3d1 core: include tags in exported note (#1345)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2022-11-23 09:19:07 +05:00
Muhammad Ali
a70961b662 core: respect numbers when sorting items (#1337)
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>
2022-11-17 19:38:05 +05:00
Abdullah Atta
8f5ebe315e core: use client given compression module 2022-11-11 17:01:01 +05:00
Abdullah Atta
205373dca3 core: use htmlparser2 for html rewriting
This replaces DOMParser with htmlparser2 which is much, much faster.
How much faster? 80%. This new implementation can parse at 50mb/s
which is insane! The old one could only do 5-10mb/s

We still haven't gotten rid of the DOMParser though since HTML-to-MD
conversion still needs it. This will be done soon though by using `dr-sax`.

This uses a custom implementation of htmlparser2 instead of the default
one which is 50% faster.
2022-11-10 15:16:13 +05:00
Abdullah Atta
e1fc116994 core: improve content conflict detection using proper HTML diffing (#1183)
Since HTML is a tree-like language it is futile to compare it character
for character. `html1 === html2` is almost always false. This commit
introduces a simple diffing algorithm that only checks the text inside
the html + a few other attributes to decide whether the 2 HTMLs are
actually different or not. This is obviously not foolproof and it will
ignore everything aesthetic (b, em, strong tags etc.). This is actually
desireable because in our case only the text difference should
warrant a conflict. Everything else can easily be brought back.
Similarly, this also ignores whitespace differences surrouding the
tags.

All in all it'll provide a more reliable alternative to MD5 hashing the
2 HTMLs.
2022-10-13 19:22:32 +05:00
Abdullah Atta
d81f5dba65 refactor: migrate to theme-ui from rebass 2022-08-31 07:26:27 +05:00
Abdullah Atta
c317774c8a docs: add license header 2022-08-30 16:17:04 +05:00
thecodrr
87b778db94 test: improve overall test coverage 2022-08-15 10:57:25 +05:00
thecodrr
16f2e651b4 fix: returned items are empty when groupby is se to none 2022-07-20 17:45:52 +05:00
thecodrr
ceea6e1668 fix: include conflicted & pinned groups when groupBy == none 2022-07-19 11:22:03 +05:00
thecodrr
530a1cc625 feat: add log messages all over the place 2022-07-19 11:16:46 +05:00
thecodrr
0a05ec3cbd fix: use DOMParser from globalThis 2022-07-15 09:42:30 +05:00
thecodrr
d7d21bc54b fix: handle "failed to fetch" errors better 2022-07-08 12:07:26 +05:00
thecodrr
383bdb1c8f fix: input.includes is not a function 2022-07-07 18:39:57 +05:00
Ammar Ahmed
6d4b9ca379 use localCompare for sorting 2022-06-17 16:52:00 +05:00
thecodrr
751305e04c perf: optimize grouping/sorting & id creation 2022-06-16 16:01:08 +05:00
thecodrr
e072d74483 fix: use linkedom/worker 2022-06-08 10:56:53 +05:00
thecodrr
ad10b6c98d feat: use linkedom 2022-04-19 00:28:42 +05:00
thecodrr
c9c57d87ab feat: migrate to happy-dom from node-html-parser 2022-04-19 00:04:57 +05:00
thecodrr
332e08c372 fix: clone array before adding header 2022-04-15 22:32:16 +05:00
thecodrr
7b57b0b916 fix: parse & throw json errors from signalr errors 2022-04-13 16:46:19 +05:00
thecodrr
1703420ca9 feat: allow grouping by none 2022-03-31 14:32:24 +05:00
thecodrr
4135028137 feat: improve sync over websockets 2022-03-30 15:52:48 +05:00
thecodrr
936fe4943e fix: fallback to error for errorMessage 2022-03-24 23:17:04 +05:00
thecodrr
799116efe4 fix: cleanup mfa endpoints 2022-03-21 10:23:35 +05:00
thecodrr
c3576520ec fix: invalid_grant errors are overriden 2022-03-17 22:56:10 +05:00
Abdullah Atta
c350da9fda feat: add mfa support (#23) 2022-03-11 22:49:24 +05:00
thecodrr
0a75048f68 fix: decode &nbsp; html5 escape codes 2022-01-20 00:18:35 +05:00
thecodrr
2e50130c16 feat: better errors when server fails 2022-01-18 12:00:57 +05:00
thecodrr
a130db41a4 fix: try to refresh token before logging out on 401 unauthorized 2022-01-07 13:58:06 +05:00
thecodrr
4bdf5a3152 revert: do not logout on 401 unauthorized 2022-01-05 18:19:02 +05:00
thecodrr
2021fe56d5 fix: force logout user on 401 unauthorized error 2022-01-03 13:26:57 +05:00
thecodrr
c089ccbe19 feat: refresh token on 401 unauthorized error 2021-12-31 09:04:13 +05:00
thecodrr
4a6e3cf774 fix: disable fetch timeout 2021-12-30 12:12:43 +05:00
thecodrr
addde688f7 feat: timeout all requests after 20 seconds 2021-12-25 12:27:23 +05:00
thecodrr
4204d8784d test: rewrite notehistory tests for improved correctness 2021-12-22 12:07:07 +05:00
thecodrr
5337dd482c refactor: extendable formatDate function 2021-12-22 10:07:23 +05:00
thecodrr
5bbff5b88d fix: decompressSync not defined 2021-12-22 09:54:34 +05:00
thecodrr
42d6cfab95 fix: change date style to (MMM DD, YYYY, HH:mm AM/PM) 2021-12-21 14:32:14 +05:00
thecodrr
eef5e96257 fix: do not use default import for fflate 2021-12-21 14:31:11 +05:00
Abdullah Atta
630bb33b10 feat: add note version history (#20)
* feat: note version history

* fix bugs

* add tests for session history

* update tests

* add tests for restoring content

* add more tests

* update jsdoc

* return empty array if no session history present for a note

* init note history with await

* add note history versions limit

* cleanup note history after adding a new session

* fix tests

* add test for session cleanup

* test: add collector tests

* feat: dateEdited -> dateModified

* feat: migrate to liqe for searching

* chore: forceExit jest after test run

* feat: note version history

* fix bugs

* add tests for session history

* update tests

* add tests for restoring content

* add more tests

* update jsdoc

* return empty array if no session history present for a note

* init note history with await

* add note history versions limit

* cleanup note history after adding a new session

* fix tests

* add test for session cleanup

* init ContentHistory with await

* fix reference to db in init

* make sessionId in db

* check if note is locked through note metadata

* make cleanup method private

* use remove methods in notehistory and contenthistory

* restore note content via notes.add method if note is not locked

* move getting all items to seperate functions

* check if parsed json is valid

* deserialize a session only if it's sessionContent exists

* add locked property to sessionContent

* remove makeSessionId function

* update tests

* remove yarn.lock file

* update tests

Co-authored-by: ammarahm-ed <ammarahmed6506@gmail.com>
2021-12-21 13:41:08 +05:00