Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

feat: remove migrated property

thecodrrd3e77a9063be
diff --git a/packages/core/api/sync/collector.js b/packages/core/api/sync/collector.js
index 838363069..6884e7298 100644
--- a/packages/core/api/sync/collector.js
+++ b/packages/core/api/sync/collector.js
@@ -64,7 +64,7 @@ class Collector {
deleted: true,
dateModified: Date.now(),
});
- } else if ((isUnsynced && isSyncable) || item.migrated) {
+ } else if (isUnsynced && isSyncable) {
prev.push({ ...item, type });
}
@@ -91,8 +91,7 @@ class Collector {
async _map(item) {
// in case of resolved content
delete item.resolved;
- // turn the migrated flag off so we don't keep syncing this item repeated
- delete item.migrated;
+ // synced is a local only property
delete item.synced;
return {
diff --git a/packages/core/collections/content.js b/packages/core/collections/content.js
index f171d1e84..1c91c6162 100644
--- a/packages/core/collections/content.js
+++ b/packages/core/collections/content.js
@@ -16,7 +16,7 @@ export default class Content extends Collection {
)}</p>`;
}
- if (content.remote || content.deleted || content.migrated)
+ if (content.remote || content.deleted)
return await this._collection.addItem(
await this.extractAttachments(content)
);
diff --git a/packages/core/collections/tags.js b/packages/core/collections/tags.js
index e3c4faedb..62491ce35 100644
--- a/packages/core/collections/tags.js
+++ b/packages/core/collections/tags.js
@@ -15,7 +15,7 @@ export default class Tags extends Collection {
}
async merge(tag) {
- if (!tag.migrated) return;
+ if (!tag) return;
await this._collection.addItem(tag);
}
diff --git a/packages/core/collections/trash.js b/packages/core/collections/trash.js
index f2e99f82c..553774b7d 100644
--- a/packages/core/collections/trash.js
+++ b/packages/core/collections/trash.js
@@ -45,9 +45,7 @@ export default class Trash {
async add(item) {
const collection = collectionNameFromItem(item);
if (!item || !item.type || !collection) return;
- // if (item.dateDeleted || item.deleted || item.migrated) {
- // return await this._collection.addItem(item);
- // }
+
await this.collections[collection]._collection.updateItem({
...item,
id: item.itemId || item.id,
diff --git a/packages/core/database/indexed-collection.js b/packages/core/database/indexed-collection.js
index eb83c2168..1fabd3d10 100644
--- a/packages/core/database/indexed-collection.js
+++ b/packages/core/database/indexed-collection.js
@@ -38,7 +38,6 @@ export default class IndexedCollection {
}
// the item has become local now, so remove the flags
delete item.remote;
- delete item.migrated;
// if (await this.getEncryptionKey()) {
// const encrypted = await this.indexer.encrypt(
@@ -47,7 +46,6 @@ export default class IndexedCollection {
// );
// encrypted.dateModified = item.dateModified;
// encrypted.localOnly = item.localOnly;
- // encrypted.migrated = item.migrated;
// encrypted.id = item.id;
// await this.indexer.write(item.id, encrypted);
// } else
diff --git a/packages/core/database/migrator.js b/packages/core/database/migrator.js
index ff1abfc20..f08fad240 100644
--- a/packages/core/database/migrator.js
+++ b/packages/core/database/migrator.js
@@ -17,7 +17,6 @@ class Migrator {
}
const migrate = migrations[version][item.type || collection.type];
if (migrate) item = migrate(item);
- item.migrated = true;
if (collection.dbCollection.merge) {
await collection.dbCollection.merge(item);