Skip to content

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

fix: remove all orphaned content on startup

thecodrrfe613fa42861
diff --git a/packages/core/collections/content.js b/packages/core/collections/content.js
index 42e7534ad..6698e16a3 100644
--- a/packages/core/collections/content.js
+++ b/packages/core/collections/content.js
@@ -61,7 +61,8 @@ export default class Content extends Collection {
let ids = [];
for (let content of allContent) {
const { noteId } = content;
- if (!this._db.notes.note(noteId)) {
+ const note = this._db.notes._collection.getItem(noteId);
+ if (!note || note.contentId !== content.id) {
ids.push(content.id);
await this._collection.deleteItem(content.id);
}