@firebase/firestore 4.7.1-canary.3670ab83c → 4.7.1-canary.629919ea7

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.
@@ -4960,7 +4960,7 @@ interface SharedClientState {
4960
4960
  * If the target id is already associated with local client, the method simply
4961
4961
  * returns its `QueryTargetState`.
4962
4962
  */
4963
- addLocalQueryTarget(targetId: TargetId): QueryTargetState;
4963
+ addLocalQueryTarget(targetId: TargetId, addToActiveTargetIds?: boolean): QueryTargetState;
4964
4964
  /** Removes the Query Target ID association from the local client. */
4965
4965
  removeLocalQueryTarget(targetId: TargetId): void;
4966
4966
  /** Checks whether the target is associated with the local client. */
@@ -60,7 +60,7 @@ export interface SharedClientState {
60
60
  * If the target id is already associated with local client, the method simply
61
61
  * returns its `QueryTargetState`.
62
62
  */
63
- addLocalQueryTarget(targetId: TargetId): QueryTargetState;
63
+ addLocalQueryTarget(targetId: TargetId, addToActiveTargetIds?: boolean): QueryTargetState;
64
64
  /** Removes the Query Target ID association from the local client. */
65
65
  removeLocalQueryTarget(targetId: TargetId): void;
66
66
  /** Checks whether the target is associated with the local client. */
@@ -232,7 +232,7 @@ export declare class WebStorageSharedClientState implements SharedClientState {
232
232
  isActiveQueryTarget(targetId: TargetId): boolean;
233
233
  addPendingMutation(batchId: BatchId): void;
234
234
  updateMutationState(batchId: BatchId, state: 'acknowledged' | 'rejected', error?: FirestoreError): void;
235
- addLocalQueryTarget(targetId: TargetId): QueryTargetState;
235
+ addLocalQueryTarget(targetId: TargetId, addToActiveTargetIds?: boolean): QueryTargetState;
236
236
  removeLocalQueryTarget(targetId: TargetId): void;
237
237
  isLocalQueryTarget(targetId: TargetId): boolean;
238
238
  clearQueryState(targetId: TargetId): void;
@@ -296,7 +296,7 @@ export declare class MemorySharedClientState implements SharedClientState {
296
296
  sequenceNumberHandler: ((sequenceNumber: ListenSequenceNumber) => void) | null;
297
297
  addPendingMutation(batchId: BatchId): void;
298
298
  updateMutationState(batchId: BatchId, state: 'acknowledged' | 'rejected', error?: FirestoreError): void;
299
- addLocalQueryTarget(targetId: TargetId): QueryTargetState;
299
+ addLocalQueryTarget(targetId: TargetId, addToActiveTargetIds?: boolean): QueryTargetState;
300
300
  updateQueryState(targetId: TargetId, state: QueryTargetState, error?: FirestoreError): void;
301
301
  removeLocalQueryTarget(targetId: TargetId): void;
302
302
  isLocalQueryTarget(targetId: TargetId): boolean;
package/dist/index.cjs.js CHANGED
@@ -71,7 +71,7 @@ User.MOCK_USER = new User("mock-user");
71
71
  * See the License for the specific language governing permissions and
72
72
  * limitations under the License.
73
73
  */
74
- let b = "10.13.1-canary.3670ab83c";
74
+ let b = "10.13.1-canary.629919ea7";
75
75
 
76
76
  /**
77
77
  * @license
@@ -13325,18 +13325,20 @@ class __PRIVATE_LocalClientState {
13325
13325
  // in order, it is safe to delete the entry right after updating it.
13326
13326
  this.Qs(e);
13327
13327
  }
13328
- addLocalQueryTarget(e) {
13329
- let t = "not-current";
13328
+ addLocalQueryTarget(e, t = !0) {
13329
+ let n = "not-current";
13330
13330
  // Lookup an existing query state if the target ID was already registered
13331
13331
  // by another tab
13332
13332
  if (this.isActiveQueryTarget(e)) {
13333
- const n = this.storage.getItem(createWebStorageQueryTargetMetadataKey(this.persistenceKey, e));
13334
- if (n) {
13335
- const r = __PRIVATE_QueryTargetMetadata.Rs(e, n);
13336
- r && (t = r.state);
13333
+ const t = this.storage.getItem(createWebStorageQueryTargetMetadataKey(this.persistenceKey, e));
13334
+ if (t) {
13335
+ const r = __PRIVATE_QueryTargetMetadata.Rs(e, t);
13336
+ r && (n = r.state);
13337
13337
  }
13338
13338
  }
13339
- return this.Ks.fs(e), this.Ns(), t;
13339
+ // If the query is listening to cache only, the target ID should not be registered with the
13340
+ // local Firestore client as an active watch target.
13341
+ return t && this.Ks.fs(e), this.Ns(), n;
13340
13342
  }
13341
13343
  removeLocalQueryTarget(e) {
13342
13344
  this.Ks.gs(e), this.Ns();
@@ -13544,8 +13546,8 @@ class __PRIVATE_MemorySharedClientState {
13544
13546
  updateMutationState(e, t, n) {
13545
13547
  // No op.
13546
13548
  }
13547
- addLocalQueryTarget(e) {
13548
- return this.so.fs(e), this.oo[e] || "not-current";
13549
+ addLocalQueryTarget(e, t = !0) {
13550
+ return t && this.so.fs(e), this.oo[e] || "not-current";
13549
13551
  }
13550
13552
  updateQueryState(e, t, n) {
13551
13553
  this.oo[e] = t;
@@ -16236,7 +16238,7 @@ async function __PRIVATE_syncEngineListen(e, t, n = !0) {
16236
16238
  }
16237
16239
 
16238
16240
  async function __PRIVATE_allocateTargetAndMaybeListen(e, t, n, r) {
16239
- const i = await __PRIVATE_localStoreAllocateTarget(e.localStore, __PRIVATE_queryToTarget(t)), s = i.targetId, o = n ? e.sharedClientState.addLocalQueryTarget(s) : "not-current";
16241
+ const i = await __PRIVATE_localStoreAllocateTarget(e.localStore, __PRIVATE_queryToTarget(t)), s = i.targetId, o = e.sharedClientState.addLocalQueryTarget(s, n);
16240
16242
  let _;
16241
16243
  return r && (_ = await __PRIVATE_initializeViewAndComputeSnapshot(e, t, s, "current" === o, i.resumeToken)),
16242
16244
  e.isPrimaryClient && n && __PRIVATE_remoteStoreListen(e.remoteStore, i), _;
@@ -22233,9 +22235,9 @@ let Me = null;
22233
22235
  return r = Object.assign({
22234
22236
  useFetchStreams: t
22235
22237
  }, r), s._setSettings(r), s;
22236
- }), "PUBLIC").setMultipleInstances(!0)), app.registerVersion(S, "4.7.1-canary.3670ab83c", e),
22238
+ }), "PUBLIC").setMultipleInstances(!0)), app.registerVersion(S, "4.7.1-canary.629919ea7", e),
22237
22239
  // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
22238
- app.registerVersion(S, "4.7.1-canary.3670ab83c", "cjs2017");
22240
+ app.registerVersion(S, "4.7.1-canary.629919ea7", "cjs2017");
22239
22241
  }();
22240
22242
 
22241
22243
  exports.AbstractUserDataWriter = AbstractUserDataWriter;