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.
This commit is contained in:
thecodrr
2021-02-22 09:33:30 +05:00
parent 465b651587
commit df4c98b27b

View File

@@ -98,10 +98,14 @@ export default class Sync {
// check for conflicts and throw // check for conflicts and throw
// await this._db.conflicts.check(); // await this._db.conflicts.check();
// update our lastSynced time // TODO test this.
if (serverResponse.lastSynced) { // we won't be updating lastSynced time here because
await this._db.context.write("lastSynced", serverResponse.lastSynced); // 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) { async _send(data, token) {