@firebase/firestore 4.7.1-canary.ca4dbcf3f → 4.7.1-canary.ff0475c41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,7 +34,7 @@ var grpc__namespace = /*#__PURE__*/_interopNamespace(grpc);
34
34
  var protoLoader__namespace = /*#__PURE__*/_interopNamespace(protoLoader);
35
35
 
36
36
  const name = "@firebase/firestore";
37
- const version$1 = "4.7.1-canary.ca4dbcf3f";
37
+ const version$1 = "4.7.1-canary.ff0475c41";
38
38
 
39
39
  /**
40
40
  * @license
@@ -87,7 +87,7 @@ User.GOOGLE_CREDENTIALS = new User('google-credentials-uid');
87
87
  User.FIRST_PARTY = new User('first-party-uid');
88
88
  User.MOCK_USER = new User('mock-user');
89
89
 
90
- const version = "10.13.1-canary.ca4dbcf3f";
90
+ const version = "10.13.1-canary.ff0475c41";
91
91
 
92
92
  /**
93
93
  * @license
@@ -18482,7 +18482,7 @@ class WebStorageSharedClientState {
18482
18482
  // in order, it is safe to delete the entry right after updating it.
18483
18483
  this.removeMutationState(batchId);
18484
18484
  }
18485
- addLocalQueryTarget(targetId) {
18485
+ addLocalQueryTarget(targetId, addToActiveTargetIds = true) {
18486
18486
  let queryState = 'not-current';
18487
18487
  // Lookup an existing query state if the target ID was already registered
18488
18488
  // by another tab
@@ -18495,7 +18495,11 @@ class WebStorageSharedClientState {
18495
18495
  }
18496
18496
  }
18497
18497
  }
18498
- this.localClientState.addQueryTarget(targetId);
18498
+ // If the query is listening to cache only, the target ID should not be registered with the
18499
+ // local Firestore client as an active watch target.
18500
+ if (addToActiveTargetIds) {
18501
+ this.localClientState.addQueryTarget(targetId);
18502
+ }
18499
18503
  this.persistClientState();
18500
18504
  return queryState;
18501
18505
  }
@@ -18773,8 +18777,10 @@ class MemorySharedClientState {
18773
18777
  updateMutationState(batchId, state, error) {
18774
18778
  // No op.
18775
18779
  }
18776
- addLocalQueryTarget(targetId) {
18777
- this.localState.addQueryTarget(targetId);
18780
+ addLocalQueryTarget(targetId, addToActiveTargetIds = true) {
18781
+ if (addToActiveTargetIds) {
18782
+ this.localState.addQueryTarget(targetId);
18783
+ }
18778
18784
  return this.queryState[targetId] || 'not-current';
18779
18785
  }
18780
18786
  updateQueryState(targetId, state, error) {
@@ -25231,9 +25237,8 @@ async function allocateTargetAndMaybeListen(syncEngineImpl, query, shouldListenT
25231
25237
  // not registering it in shared client state, and directly calculate initial snapshots and
25232
25238
  // subsequent updates from cache. Otherwise, register the target ID with local Firestore client
25233
25239
  // as active watch target.
25234
- const status = shouldListenToRemote
25235
- ? syncEngineImpl.sharedClientState.addLocalQueryTarget(targetId)
25236
- : 'not-current';
25240
+ const status = syncEngineImpl.sharedClientState.addLocalQueryTarget(targetId,
25241
+ /* addToActiveTargetIds= */ shouldListenToRemote);
25237
25242
  let viewSnapshot;
25238
25243
  if (shouldInitializeView) {
25239
25244
  viewSnapshot = await initializeViewAndComputeSnapshot(syncEngineImpl, query, targetId, status === 'current', targetData.resumeToken);