mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-22 22:49:45 +01:00
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.
This commit is contained in:
committed by
Abdullah Atta
parent
ab38d89314
commit
201366b39e
@@ -371,6 +371,8 @@ class Sync {
|
||||
async onRemoteSyncCompleted(lastSynced) {
|
||||
// refresh monographs on sync completed
|
||||
await this.db.monographs.init();
|
||||
// refresh topic references
|
||||
this.db.notes.topicReferences.refresh();
|
||||
|
||||
await this.start(false, false, lastSynced);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user