You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
Add a save() method to the store interface
Originally I just piggy-backed off setSyncToken() but this was] non-obvious that depending on the store it might do writes to the database. This was exacerbated by the fact that the save needs to be done at the "right time" (after sync data is accumulated and after the sync response has been processed) and setSyncToken was being called too early. A save() method fixes both these things.
This commit is contained in:
@@ -570,6 +570,10 @@ SyncApi.prototype._sync = function(syncOptions) {
|
||||
// keep emitting SYNCING -> SYNCING for clients who want to do bulk updates
|
||||
self._updateSyncState("SYNCING", syncEventData);
|
||||
|
||||
// tell databases that everything is now in a consistent state and can be
|
||||
// saved.
|
||||
client.store.save();
|
||||
|
||||
self._sync(syncOptions);
|
||||
}, function(err) {
|
||||
if (!self._running) {
|
||||
|
||||
Reference in New Issue
Block a user