From a38917f9200a3a9d8172588bcbe05a3dc3c494ac Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 28 Mar 2017 14:57:11 +0100 Subject: [PATCH] Don't be SYNCING until updating from the server Syncing should probably mean the stream is up to date and streaming messages in real-time from the server, which is not the case if we've only loaded the cached response. Stay PREPARED until we actually get the latest from the server. --- src/sync.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sync.js b/src/sync.js index c9573a418..4ca1aacf5 100644 --- a/src/sync.js +++ b/src/sync.js @@ -605,7 +605,9 @@ SyncApi.prototype._sync = function(syncOptions) { } // keep emitting SYNCING -> SYNCING for clients who want to do bulk updates - self._updateSyncState("SYNCING", syncEventData); + if (!isCachedResponse) { + self._updateSyncState("SYNCING", syncEventData); + } // tell databases that everything is now in a consistent state and can be // saved.