@@ -273,6 +273,8 @@ export class View {
273
273
* @param docChanges - The set of changes to make to the view's docs.
274
274
* @param updateLimboDocuments - Whether to update limbo documents based on
275
275
* this change.
276
+ * @param isPendingForRequeryResult - Whether the target is pending to run a full
277
+ * re-query due to existence filter mismatch.
276
278
* @param targetChange - A target change to apply for computing limbo docs and
277
279
* sync state.
278
280
* @returns A new ViewChange with the given docs, changes, and sync state.
@@ -281,7 +283,8 @@ export class View {
281
283
applyChanges (
282
284
docChanges : ViewDocumentChanges ,
283
285
updateLimboDocuments : boolean ,
284
- targetChange ?: TargetChange
286
+ targetChange ?: TargetChange ,
287
+ isPendingForRequeryResult : boolean = false ,
285
288
) : ViewChange {
286
289
debugAssert (
287
290
! docChanges . needsRefill ,
@@ -300,10 +303,16 @@ export class View {
300
303
} ) ;
301
304
302
305
this . applyTargetChange ( targetChange ) ;
303
- const limboChanges = updateLimboDocuments
306
+ const limboChanges = ! isPendingForRequeryResult && updateLimboDocuments
304
307
? this . updateLimboDocuments ( )
305
308
: [ ] ;
306
- const synced = this . limboDocuments . size === 0 && this . current ;
309
+
310
+ // We are at synced state if there is no limbo docs are waiting to be resolved, view is current
311
+ // with the backend, and the query is not pending for full re-query result due to existence
312
+ // filter mismatch.
313
+ const synced =
314
+ this . limboDocuments . size === 0 && this . current && ! isPendingForRequeryResult ;
315
+
307
316
const newSyncState = synced ? SyncState . Synced : SyncState . Local ;
308
317
const syncStateChanged = newSyncState !== this . syncState ;
309
318
this . syncState = newSyncState ;
0 commit comments