Commit Graph

2058 Commits

Author SHA1 Message Date
Abdullah Atta
ea6a706c25 core: fix failing note-history test 2022-10-18 10:34:59 +05:00
Abdullah Atta
3ac3b1bcdb global: update package-lock files 2022-10-17 23:08:39 +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
2cddbabee1 core: remove reindexing before backup import 2022-10-17 22:43:55 +05:00
Abdullah Atta
112497b1b6 core: add progress during migration & backup restore 2022-10-17 22:43:26 +05:00
Abdullah Atta
d35d355fb3 web: move backup time forward when it is skipped 2022-10-17 22:39:54 +05:00
Abdullah Atta
6bf14512f9 core: fix cannot read property title of undefined 2022-10-17 22:38:50 +05:00
Abdullah Atta
0d20013071 core: do not check premium status during tag addition 2022-10-17 22:37:48 +05:00
Abdullah Atta
cf8ed91102 core: use migrations to dedup shortcuts 2022-10-17 22:37:23 +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
1a589b0955 core: refactor migrations to use items instead of types 2022-10-17 20:00:00 +05:00
Abdullah Atta
36f3701b4f web: allow exporting all notes as html, md or txt 2022-10-14 17:49:38 +05:00
Abdullah Atta
5886c47d92 editor: update packages 2022-10-14 12:23:40 +05:00
Abdullah Atta
fc19335a26 core: publish appRefreshRequested event globally 2022-10-13 19:35:32 +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
0a94ee7c60 core: item should only have a single shortcut
this changes the shortcut ids & deduplicates the old ones so that
there is always only 1 shortcut of a given item (notebook, topic or tag).
2022-10-13 19:18:52 +05:00
Abdullah Atta
0e6150a0f5 core: change db keys to include collection name
This should not affect the items or their server representation.
This change is necessary to allow multiple items with same id
that live in different collections.
For example, shortcuts have the same id as the inner reference they
point to. This was not possible before and would cause an overwrite
of the original value.
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
b5ab8e5d3e core: allow free users to assign same 5 tags without limits 2022-10-12 20:16:26 +05:00
Ammar Ahmed
dc92f40ee2 Merge pull request #1104 from streetwriters/fix-migration-flow
Fix migration flow
2022-09-29 20:26:03 +05:00
Abdullah Atta
ce889cf1c3 web: bump version to v2.2.1 2022-09-29 19:05:25 +05:00
Abdullah Atta
6469c6d689 core: forcefully set item type to tiptap if it is content 2022-09-29 16:59:43 +05:00
Abdullah Atta
20819325fb core: add null sanity checks in migration 2022-09-29 15:12:20 +05:00
Abdullah Atta
b3ea6523ae global: set license prop of all package.json files to GPL-3.0-or-later 2022-09-26 15:30:16 +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
Abdullah Atta
a7901b0323 core: sku property in pricing test should be generic 2022-09-09 01:17:27 +05:00
Abdullah Atta
3f73b47121 core: use generic snapshot for pricing test
this is because the pricing response data contains location based data like
country, countryCode, pricing etc. Running it on different
computers will generate different data. To avoid this we
should test only the types of each property using `jest`'s
propertyMatchers
2022-09-09 01:12:45 +05:00
Abdullah Atta
78c1df8723 core: add pricing test snapshot 2022-09-09 00:56:43 +05:00
Abdullah Atta
42c745088a ci: add @notesnook/core test workflow 2022-09-09 00:14:21 +05:00
ammarahm-ed
c8dc5207b4 core: fix auto sync does not send sync complete event 2022-09-08 18:30:49 +05:00
ammarahm-ed
79d492e186 core: fix shortcut not removed 2022-09-08 14:16:25 +05:00
ammarahm-ed
56f26f3c95 core: this.find > this.shortcut 2022-09-08 14:08:44 +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
f8d94bc12a core: allow removing shortcuts by item.id 2022-09-07 14:18:48 +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
ammarahm-ed
d25be38928 config: add test builds to targetDefaults nx 2022-09-01 15:23:21 +05:00
Abdullah Atta
184236f01d docs: add README for @notesnook/core 2022-08-31 20:04:15 +05:00
Abdullah Atta
8fa4e2184f config: streamline running core tests
by default running `npm run test:core` will only run unit tests.
E2E tests require setting up credentials in the .env file.
Until we figure out a way to streamline this whole process,
this is how the tests will be run.
2022-08-31 20:03:58 +05:00
Abdullah Atta
da58248456 web: migrate list-container to typescript 2022-08-31 15:48:51 +05:00