Skip to content

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

fix: merge conflict detection when merging via sse

thecodrr35995784d92f
diff --git a/packages/core/api/sync/index.js b/packages/core/api/sync/index.js
index aad1bb6bf..44ef5871c 100644
--- a/packages/core/api/sync/index.js
+++ b/packages/core/api/sync/index.js
@@ -91,6 +91,10 @@ export default class Sync {
async eventMerge(serverResponse) {
let { user, lastSynced } = await this._performChecks();
+
+ // we update the last synced time before merging so there are no conflicts
+ lastSynced = serverResponse.lastSynced;
+
// merge the server response
await this._merger.merge(serverResponse, lastSynced);