@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.
@@ -9,7 +9,7 @@ import * as grpc from '@grpc/grpc-js';
9
9
  import * as protoLoader from '@grpc/proto-loader';
10
10
 
11
11
  const name = "@firebase/firestore";
12
- const version$1 = "4.7.1-canary.ca4dbcf3f";
12
+ const version$1 = "4.7.1-canary.ff0475c41";
13
13
 
14
14
  /**
15
15
  * @license
@@ -62,7 +62,7 @@ User.GOOGLE_CREDENTIALS = new User('google-credentials-uid');
62
62
  User.FIRST_PARTY = new User('first-party-uid');
63
63
  User.MOCK_USER = new User('mock-user');
64
64
 
65
- const version = "10.13.1-canary.ca4dbcf3f";
65
+ const version = "10.13.1-canary.ff0475c41";
66
66
 
67
67
  /**
68
68
  * @license
@@ -18457,7 +18457,7 @@ class WebStorageSharedClientState {
18457
18457
  // in order, it is safe to delete the entry right after updating it.
18458
18458
  this.removeMutationState(batchId);
18459
18459
  }
18460
- addLocalQueryTarget(targetId) {
18460
+ addLocalQueryTarget(targetId, addToActiveTargetIds = true) {
18461
18461
  let queryState = 'not-current';
18462
18462
  // Lookup an existing query state if the target ID was already registered
18463
18463
  // by another tab
@@ -18470,7 +18470,11 @@ class WebStorageSharedClientState {
18470
18470
  }
18471
18471
  }
18472
18472
  }
18473
- this.localClientState.addQueryTarget(targetId);
18473
+ // If the query is listening to cache only, the target ID should not be registered with the
18474
+ // local Firestore client as an active watch target.
18475
+ if (addToActiveTargetIds) {
18476
+ this.localClientState.addQueryTarget(targetId);
18477
+ }
18474
18478
  this.persistClientState();
18475
18479
  return queryState;
18476
18480
  }
@@ -18748,8 +18752,10 @@ class MemorySharedClientState {
18748
18752
  updateMutationState(batchId, state, error) {
18749
18753
  // No op.
18750
18754
  }
18751
- addLocalQueryTarget(targetId) {
18752
- this.localState.addQueryTarget(targetId);
18755
+ addLocalQueryTarget(targetId, addToActiveTargetIds = true) {
18756
+ if (addToActiveTargetIds) {
18757
+ this.localState.addQueryTarget(targetId);
18758
+ }
18753
18759
  return this.queryState[targetId] || 'not-current';
18754
18760
  }
18755
18761
  updateQueryState(targetId, state, error) {
@@ -25206,9 +25212,8 @@ async function allocateTargetAndMaybeListen(syncEngineImpl, query, shouldListenT
25206
25212
  // not registering it in shared client state, and directly calculate initial snapshots and
25207
25213
  // subsequent updates from cache. Otherwise, register the target ID with local Firestore client
25208
25214
  // as active watch target.
25209
- const status = shouldListenToRemote
25210
- ? syncEngineImpl.sharedClientState.addLocalQueryTarget(targetId)
25211
- : 'not-current';
25215
+ const status = syncEngineImpl.sharedClientState.addLocalQueryTarget(targetId,
25216
+ /* addToActiveTargetIds= */ shouldListenToRemote);
25212
25217
  let viewSnapshot;
25213
25218
  if (shouldInitializeView) {
25214
25219
  viewSnapshot = await initializeViewAndComputeSnapshot(syncEngineImpl, query, targetId, status === 'current', targetData.resumeToken);