From df4c98b27bfec1db918c06d4fd02130f3da4677f Mon Sep 17 00:00:00 2001 From: thecodrr Date: Mon, 22 Feb 2021 09:33:30 +0500 Subject: [PATCH] fix: do not update lastSynced time on SSE sync we won't be updating lastSynced time because it can cause the lastSynced time to move ahead of any last edited (but unsynced) note resulting in edited notes not getting synced. --- packages/core/api/sync/index.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/core/api/sync/index.js b/packages/core/api/sync/index.js index f381b2687..54c1b0d57 100644 --- a/packages/core/api/sync/index.js +++ b/packages/core/api/sync/index.js @@ -98,10 +98,14 @@ export default class Sync { // check for conflicts and throw // await this._db.conflicts.check(); - // update our lastSynced time - if (serverResponse.lastSynced) { - await this._db.context.write("lastSynced", serverResponse.lastSynced); - } + // TODO test this. + // we won't be updating lastSynced time here because + // it can cause the lastSynced time to move ahead of any + // last edited (but unsynced) time resulting in edited notes + // not getting synced. + // if (serverResponse.lastSynced) { + // await this._db.context.write("lastSynced", serverResponse.lastSynced); + // } } async _send(data, token) {