A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
core: fix restored notes not syncing (closes #3472)
Abdullah Attadbfb1168fbb4
diff --git a/packages/core/src/database/backup.js b/packages/core/src/database/backup.jsindex 08d931ea8..7e604552a 100644--- a/packages/core/src/database/backup.js+++ b/packages/core/src/database/backup.js@@ -249,7 +249,8 @@ export default class Backup {const toAdd = {};for (const item of Array.isArray(data) ? data : Object.values(data)) {// we do not want to restore deleted items- if (!item || (!item.type && item.deleted)) continue;+ if (!item || (!item.type && item.deleted) || typeof item !== "object")+ continue;// in v5.6 of the database, we did not set note history session's typeif (!item.type && item.sessionContentId) item.type = "notehistory";@@ -265,6 +266,10 @@ export default class Backup {? "color": item.itemType || item.type;+ // items should sync immediately after getting restored+ item.dateModified = Date.now();+ item.synced = false;+const collectionKey = itemTypeToCollectionKey[itemType];if (collectionKey) {toAdd[collectionKey] = toAdd[collectionKey] || [];