Skip to content

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

fix: deleted attachments not syncing

thecodrr09cc9774b8e7
diff --git a/packages/core/collections/attachments.js b/packages/core/collections/attachments.js
index 48bfe100b..9d469e0b7 100644
--- a/packages/core/collections/attachments.js
+++ b/packages/core/collections/attachments.js
@@ -323,9 +323,11 @@ export default class Attachments extends Collection {
}
get syncable() {
- return this.all.filter(
- (attachment) => attachment.dateUploaded > 0 || attachment.deleted
- );
+ return this._collection
+ .getRaw()
+ .filter(
+ (attachment) => attachment.dateUploaded > 0 || attachment.deleted
+ );
}
get deleted() {
diff --git a/packages/core/collections/content.js b/packages/core/collections/content.js
index 9c5ac8001..af6fa54e3 100644
--- a/packages/core/collections/content.js
+++ b/packages/core/collections/content.js
@@ -142,6 +142,7 @@ export default class Content extends Collection {
const allAttachments = this._db.attachments.all;
const content = getContentFromData(contentItem.type, contentItem.data);
+ if (!content) return contentItem;
const { data, attachments } = await content.extractAttachments(
(data, type) => this._db.attachments.save(data, type)
);