@@ -273,10 +273,10 @@ 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 waitForRequeryResult - Whether the target is pending to run a full
277
- * re-query due to existence filter mismatch.
278
276
* @param targetChange - A target change to apply for computing limbo docs and
279
277
* sync state.
278
+ * @param waitForRequeryResult - Whether the target is pending to run a full
279
+ * re-query due to existence filter mismatch.
280
280
* @returns A new ViewChange with the given docs, changes, and sync state.
281
281
*/
282
282
// PORTING NOTE: The iOS/Android clients always compute limbo document changes.
@@ -303,10 +303,9 @@ export class View {
303
303
} ) ;
304
304
305
305
this . applyTargetChange ( targetChange ) ;
306
- const limboChanges =
307
- ! waitForRequeryResult && updateLimboDocuments
308
- ? this . updateLimboDocuments ( )
309
- : [ ] ;
306
+ const limboChanges = updateLimboDocuments
307
+ ? this . updateLimboDocuments ( waitForRequeryResult ?? false )
308
+ : [ ] ;
310
309
311
310
// We are at synced state if there is no limbo docs are waiting to be resolved, view is current
312
311
// with the backend, and the query is not pending for full re-query result due to existence
@@ -413,9 +412,11 @@ export class View {
413
412
}
414
413
}
415
414
416
- private updateLimboDocuments ( ) : LimboDocumentChange [ ] {
415
+ private updateLimboDocuments (
416
+ waitForRequeryResult : boolean
417
+ ) : LimboDocumentChange [ ] {
417
418
// We can only determine limbo documents when we're in-sync with the server.
418
- if ( ! this . current ) {
419
+ if ( waitForRequeryResult || ! this . current ) {
419
420
return [ ] ;
420
421
}
421
422
0 commit comments