Commit Graph

630 Commits

Author SHA1 Message Date
Abdullah Atta
b439571e17 core: add support for changing account email 2023-01-09 16:20:26 +05:00
Abdullah Atta
4fe2f91175 core: throw error if refresh token is not found 2023-01-07 12:48:34 +05:00
Abdullah Atta
d0ddaeba73 core: don't save empty token response 2023-01-06 17:44:07 +05:00
Abdullah Atta
06ad68975f core: fix Cannot read properties of undefined (reading 'slice') 2023-01-06 17:44:07 +05:00
Abdullah Atta
22871d8baf core: use the new login flow in all tests 2023-01-06 17:44:07 +05:00
Abdullah Atta
8c87d00102 core: use access_token from response instead of via errors
This is more in line with how auth works:

1. You send a request with credentials
2. The server responds with an access_token

The only difference in this approach is that the client
cannot decide which scopes it wants.
2023-01-06 17:44:07 +05:00
Abdullah Atta
12d1b3fcc9 core: impl new 3-step authentication flow (& deprecate old one) 2023-01-06 17:44:07 +05:00
ammarahm-ed
7ac8b478ed core: make resolve function sync 2023-01-05 22:01:01 +05:00
ammarahm-ed
946fd3fc1d core: add reminders lookup 2023-01-05 22:01:01 +05:00
Abdullah Atta
baa06ebd6e core: add collection to hold all item<->item references 2023-01-05 22:01:01 +05:00
Abdullah Atta
a8f1fbf6a1 core: add collection for reminders 2023-01-05 22:01:01 +05:00
Abdullah Atta
088235a46d web: add support for disabling sync & auto sync 2023-01-03 21:46:11 +05:00
Abdullah Atta
f1a2afd9d6 core: do not sync vault key alone
this caused a sync loop because vault key is always synced regardless of
whether it has changed or not.
2022-12-02 11:24:56 +05:00
Abdullah Atta
0c0dff3b28 core: fix "Cannot send data if connection is not in "Connected" state" 2022-11-23 12:19:12 +05:00
Abdullah Atta
3ab6c4646c core: use mutex to establish only 1 connection at a time 2022-11-23 12:19:12 +05:00
Abdullah Atta
8f5ebe315e core: use client given compression module 2022-11-11 17:01:01 +05:00
Abdullah Atta
349cd27650 core: refactor collector to do everything in 1 step
This will speed up the sync slightly since we aren't iterating over all
items twice. It also simplifies the code a bit.
2022-11-10 14:38:32 +05:00
Abdullah Atta
62b93fa5b3 core: fix Cannot read property 'hash' of undefined 2022-10-26 15:16:25 +05:00
Abdullah Atta
7b458a56b2 core: revert "make sync hub connection more reliable" 2022-10-26 08:51:18 +05:00
Abdullah Atta
e25d4a3039 global: update qclone to 1.2.0 2022-10-19 12:10:31 +05:00
Abdullah Atta
0b971bda38 core: minor refactors 2022-10-17 22:46:43 +05:00
Abdullah Atta
73b09847b8 core: make sync hub connection more reliable 2022-10-17 22:46:31 +05:00
Abdullah Atta
577d50b512 core: move index migrations to main database migrations
this is better design wise as we won't have to keep checking if the
indices have been migrated or not. We'll just check the database version
and do the appropriate migrations based on that.
2022-10-17 22:36:53 +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
f3fa7fe744 core: update core version to 5.8 2022-10-13 19:18:52 +05:00
Abdullah Atta
c09715d053 core: make item migration fall through all db versions
this was not exactly a bug but it can cause a lot of unintended
behaviour. Previously, you'd have to manually specify which version the
item migration should jump to. This was buggy and poorly designed.
This change makes the item iterate over all the db migrations one by one
automatically.

For example:

An item at version 5.2 will go through:
- 5.3
- 5.4
- and so on
2022-10-13 19:18:52 +05:00
Abdullah Atta
c6201532f2 core: lookup by tag alias 2022-10-12 20:16:26 +05:00
Abdullah Atta
7c99c3acb9 core: add migrations for notebooks & settings (#1020) 2022-09-21 11:47:09 +05:00
Abdullah Atta
6c613c6f1e Merge branch 'move-pins-out' 2022-09-21 10:45:58 +05:00
Ammar Ahmed
e5e965415d feat: realtime & auto sync for all users (#944) 2022-09-20 18:33:55 +05:00
Abdullah Atta
ca0d746966 core: fail fast if sync connection fails
this adds reslience to the sync logic in cases where network
isn't responding or is very slow to respond. Previously there were
cases where the sync would get stuck in Connecting state.
This will no longer happen.
2022-09-19 16:20:12 +05:00
Abdullah Atta
df06881eee core: lowercase email before login/signup 2022-09-16 11:16:16 +05:00
Abdullah Atta
c954590585 core: look into topics when searching notebooks 2022-09-14 11:44:04 +05:00
ammarahm-ed
c8dc5207b4 core: fix auto sync does not send sync complete event 2022-09-08 18:30:49 +05:00
Abdullah Atta
201366b39e core: get rid of noteIds in notebook topics
This is a BREAKING change in the core & will require updating the
clients. The way it works is instead of keeping noteIds of all the
notes in the topic, it keeps an in-memory cache. This in-memory
cache `topicReferences` lives in the notes collection & decouples
notes from notebooks/topics. This also simplifies all the different
actions where references would persist after the note was deleted.
Since the note acts as the source of truth for where it currently is,
there is nothing else to do except rebuild the `topicReferences`
cache.
2022-09-08 13:39:06 +05:00
Abdullah Atta
ac7aad93b3 core: shorcuts -> shortcuts 2022-09-07 14:13:26 +05:00
Abdullah Atta
1e99d7732c core: add new collection for shortcuts 2022-09-07 12:47:02 +05:00
Abdullah Atta
ef552f8b38 core: remove pins from settings 2022-09-07 12:46:49 +05:00
Abdullah Atta
289e6eefb3 core: move pricing test to e2e tests 2022-09-05 18:00:33 +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
f1ceecf982 fix: log error (as warning) during connection check 2022-08-16 09:23:49 +05:00
thecodrr
e4b1399d45 fix: refresh monographs on sync complete 2022-08-15 19:08:43 +05:00
thecodrr
87b778db94 test: improve overall test coverage 2022-08-15 10:57:25 +05:00
thecodrr
db324b6b87 test: fix collector test 2022-08-06 11:05:16 +05:00
thecodrr
cf9bad7db8 fix: content type being set to "content" during sync
this bug broke export/publishing & basically
everything that depends on content type
to function.
2022-08-06 10:45:15 +05:00
thecodrr
52aec19b4c fix: title of locked note cannot be changed 2022-07-26 23:11:22 +05:00
thecodrr
7e9ee3f9e5 fix: initialize tag mutex in constructor 2022-07-25 16:26:44 +05:00
thecodrr
5b96009875 fix: merge settings with conflict expectation 2022-07-20 19:55:00 +05:00
thecodrr
5fb68bb08e fix: ensure that settings object is reset on logout 2022-07-20 18:29:42 +05:00