@firebase/firestore 4.4.0-canary.2e32eebb5 → 4.4.0-canary.50b2182d7
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.
- package/dist/index.cjs.js +74 -74
- package/dist/index.esm2017.js +74 -74
- package/dist/index.esm5.js +68 -68
- package/dist/index.node.cjs.js +2 -2
- package/dist/index.node.mjs +2 -2
- package/dist/index.rn.js +78 -78
- package/dist/lite/index.browser.esm2017.js +2 -2
- package/dist/lite/index.browser.esm5.js +2 -2
- package/dist/lite/index.cjs.js +2 -2
- package/dist/lite/index.node.cjs.js +2 -2
- package/dist/lite/index.node.mjs +2 -2
- package/dist/lite/index.rn.esm2017.js +2 -2
- package/dist/packages/firestore/dist/index.esm2017.d.ts +14 -14
- package/package.json +9 -9
package/dist/index.cjs.js
CHANGED
|
@@ -70,7 +70,7 @@ User.MOCK_USER = new User("mock-user");
|
|
|
70
70
|
* See the License for the specific language governing permissions and
|
|
71
71
|
* limitations under the License.
|
|
72
72
|
*/
|
|
73
|
-
let S = "10.7.1-canary.
|
|
73
|
+
let S = "10.7.1-canary.50b2182d7";
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* @license
|
|
@@ -5841,16 +5841,16 @@ class BloomFilter {
|
|
|
5841
5841
|
throw new __PRIVATE_BloomFilterError(`Invalid padding when bitmap length is 0: ${t}`);
|
|
5842
5842
|
this.Te = 8 * e.length - t,
|
|
5843
5843
|
// Set the bit count in Integer to avoid repetition in mightContain().
|
|
5844
|
-
this.
|
|
5844
|
+
this.de = webchannelWrapper.Integer.fromNumber(this.Te);
|
|
5845
5845
|
}
|
|
5846
5846
|
// Calculate the ith hash value based on the hashed 64bit integers,
|
|
5847
5847
|
// and calculate its corresponding bit index in the bitmap to be checked.
|
|
5848
|
-
|
|
5848
|
+
Ee(e, t, n) {
|
|
5849
5849
|
// Calculate hashed value h(i) = h1 + (i * h2).
|
|
5850
5850
|
let r = e.add(t.multiply(webchannelWrapper.Integer.fromNumber(n)));
|
|
5851
5851
|
// Wrap if hash value overflow 64bit.
|
|
5852
5852
|
return 1 === r.compare(le) && (r = new webchannelWrapper.Integer([ r.getBits(0), r.getBits(1) ], 0)),
|
|
5853
|
-
r.modulo(this.
|
|
5853
|
+
r.modulo(this.de).toNumber();
|
|
5854
5854
|
}
|
|
5855
5855
|
// Return whether the bit on the given index in the bitmap is set to 1.
|
|
5856
5856
|
Ae(e) {
|
|
@@ -5861,7 +5861,7 @@ class BloomFilter {
|
|
|
5861
5861
|
if (0 === this.Te) return !1;
|
|
5862
5862
|
const t = __PRIVATE_getMd5HashValue(e), [n, r] = __PRIVATE_get64BitUints(t);
|
|
5863
5863
|
for (let e = 0; e < this.hashCount; e++) {
|
|
5864
|
-
const t = this.
|
|
5864
|
+
const t = this.Ee(n, r, e);
|
|
5865
5865
|
if (!this.Ae(t)) return !1;
|
|
5866
5866
|
}
|
|
5867
5867
|
return !0;
|
|
@@ -5874,7 +5874,7 @@ class BloomFilter {
|
|
|
5874
5874
|
if (0 === this.Te) return;
|
|
5875
5875
|
const t = __PRIVATE_getMd5HashValue(e), [n, r] = __PRIVATE_get64BitUints(t);
|
|
5876
5876
|
for (let e = 0; e < this.hashCount; e++) {
|
|
5877
|
-
const t = this.
|
|
5877
|
+
const t = this.Ee(n, r, e);
|
|
5878
5878
|
this.Re(t);
|
|
5879
5879
|
}
|
|
5880
5880
|
}
|
|
@@ -7587,18 +7587,18 @@ class __PRIVATE_FirestoreIndexValueWriter {
|
|
|
7587
7587
|
}
|
|
7588
7588
|
Pt(e, t) {
|
|
7589
7589
|
if ("nullValue" in e) this.Tt(t, 5); else if ("booleanValue" in e) this.Tt(t, 10),
|
|
7590
|
-
t.
|
|
7590
|
+
t.dt(e.booleanValue ? 1 : 0); else if ("integerValue" in e) this.Tt(t, 15), t.dt(__PRIVATE_normalizeNumber(e.integerValue)); else if ("doubleValue" in e) {
|
|
7591
7591
|
const n = __PRIVATE_normalizeNumber(e.doubleValue);
|
|
7592
7592
|
isNaN(n) ? this.Tt(t, 13) : (this.Tt(t, 15), __PRIVATE_isNegativeZero(n) ?
|
|
7593
7593
|
// -0.0, 0 and 0.0 are all considered the same
|
|
7594
|
-
t.
|
|
7594
|
+
t.dt(0) : t.dt(n));
|
|
7595
7595
|
} else if ("timestampValue" in e) {
|
|
7596
7596
|
const n = e.timestampValue;
|
|
7597
|
-
this.Tt(t, 20), "string" == typeof n ? t.
|
|
7597
|
+
this.Tt(t, 20), "string" == typeof n ? t.Et(n) : (t.Et(`${n.seconds || ""}`), t.dt(n.nanos || 0));
|
|
7598
7598
|
} else if ("stringValue" in e) this.At(e.stringValue, t), this.Rt(t); else if ("bytesValue" in e) this.Tt(t, 30),
|
|
7599
7599
|
t.Vt(__PRIVATE_normalizeByteString(e.bytesValue)), this.Rt(t); else if ("referenceValue" in e) this.ft(e.referenceValue, t); else if ("geoPointValue" in e) {
|
|
7600
7600
|
const n = e.geoPointValue;
|
|
7601
|
-
this.Tt(t, 45), t.
|
|
7601
|
+
this.Tt(t, 45), t.dt(n.latitude || 0), t.dt(n.longitude || 0);
|
|
7602
7602
|
} else "mapValue" in e ? __PRIVATE_isMaxValue(e) ? this.Tt(t, Number.MAX_SAFE_INTEGER) : (this.gt(e.mapValue, t),
|
|
7603
7603
|
this.Rt(t)) : "arrayValue" in e ? (this.yt(e.arrayValue, t), this.Rt(t)) : fail();
|
|
7604
7604
|
}
|
|
@@ -7606,7 +7606,7 @@ class __PRIVATE_FirestoreIndexValueWriter {
|
|
|
7606
7606
|
this.Tt(t, 25), this.wt(e, t);
|
|
7607
7607
|
}
|
|
7608
7608
|
wt(e, t) {
|
|
7609
|
-
t.
|
|
7609
|
+
t.Et(e);
|
|
7610
7610
|
}
|
|
7611
7611
|
gt(e, t) {
|
|
7612
7612
|
const n = e.fields || {};
|
|
@@ -7625,13 +7625,13 @@ class __PRIVATE_FirestoreIndexValueWriter {
|
|
|
7625
7625
|
}));
|
|
7626
7626
|
}
|
|
7627
7627
|
Tt(e, t) {
|
|
7628
|
-
e.
|
|
7628
|
+
e.dt(t);
|
|
7629
7629
|
}
|
|
7630
7630
|
Rt(e) {
|
|
7631
7631
|
// While the SDK does not implement truncation, the truncation marker is
|
|
7632
7632
|
// used to terminate all variable length values (which are strings, bytes,
|
|
7633
7633
|
// references, arrays and maps).
|
|
7634
|
-
e.
|
|
7634
|
+
e.dt(2);
|
|
7635
7635
|
}
|
|
7636
7636
|
}
|
|
7637
7637
|
|
|
@@ -7818,10 +7818,10 @@ class __PRIVATE_AscendingIndexByteEncoder {
|
|
|
7818
7818
|
Vt(e) {
|
|
7819
7819
|
this.Wt.bt(e);
|
|
7820
7820
|
}
|
|
7821
|
-
|
|
7821
|
+
Et(e) {
|
|
7822
7822
|
this.Wt.xt(e);
|
|
7823
7823
|
}
|
|
7824
|
-
|
|
7824
|
+
dt(e) {
|
|
7825
7825
|
this.Wt.Nt(e);
|
|
7826
7826
|
}
|
|
7827
7827
|
It() {
|
|
@@ -7836,10 +7836,10 @@ class __PRIVATE_DescendingIndexByteEncoder {
|
|
|
7836
7836
|
Vt(e) {
|
|
7837
7837
|
this.Wt.vt(e);
|
|
7838
7838
|
}
|
|
7839
|
-
|
|
7839
|
+
Et(e) {
|
|
7840
7840
|
this.Wt.Ot(e);
|
|
7841
7841
|
}
|
|
7842
|
-
|
|
7842
|
+
dt(e) {
|
|
7843
7843
|
this.Wt.kt(e);
|
|
7844
7844
|
}
|
|
7845
7845
|
It() {
|
|
@@ -8570,7 +8570,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8570
8570
|
// combined with the values from the query bounds.
|
|
8571
8571
|
const _ = (null != t ? t.length : 1) * Math.max(n.length, i.length), a = _ / (null != t ? t.length : 1), u = [];
|
|
8572
8572
|
for (let c = 0; c < _; ++c) {
|
|
8573
|
-
const _ = t ? this.In(t[c / a]) : Te, l = this.Tn(e, _, n[c % a], r), h = this.
|
|
8573
|
+
const _ = t ? this.In(t[c / a]) : Te, l = this.Tn(e, _, n[c % a], r), h = this.dn(e, _, i[c % a], s), P = o.map((t => this.Tn(e, _, t,
|
|
8574
8574
|
/* inclusive= */ !0)));
|
|
8575
8575
|
u.push(...this.createRange(l, h, P));
|
|
8576
8576
|
}
|
|
@@ -8580,7 +8580,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8580
8580
|
const i = new __PRIVATE_IndexEntry(e, DocumentKey.empty(), t, n);
|
|
8581
8581
|
return r ? i : i.Ht();
|
|
8582
8582
|
}
|
|
8583
|
-
/** Generates the upper bound for `arrayValue` and `directionalValue`. */
|
|
8583
|
+
/** Generates the upper bound for `arrayValue` and `directionalValue`. */ dn(e, t, n, r) {
|
|
8584
8584
|
const i = new __PRIVATE_IndexEntry(e, DocumentKey.empty(), t, n);
|
|
8585
8585
|
return r ? i.Ht() : i;
|
|
8586
8586
|
}
|
|
@@ -8628,7 +8628,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8628
8628
|
* Returns the byte encoded form of the directional values in the field index.
|
|
8629
8629
|
* Returns `null` if the document does not have all fields specified in the
|
|
8630
8630
|
* index.
|
|
8631
|
-
*/
|
|
8631
|
+
*/ En(e, t) {
|
|
8632
8632
|
const n = new __PRIVATE_IndexByteEncoder;
|
|
8633
8633
|
for (const r of __PRIVATE_fieldIndexGetDirectionalSegments(e)) {
|
|
8634
8634
|
const e = t.data.field(r.fieldPath);
|
|
@@ -8761,7 +8761,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8761
8761
|
}
|
|
8762
8762
|
/** Creates the index entries for the given document. */ pn(e, t) {
|
|
8763
8763
|
let n = new SortedSet(__PRIVATE_indexEntryComparator);
|
|
8764
|
-
const r = this.
|
|
8764
|
+
const r = this.En(t, e);
|
|
8765
8765
|
if (null == r) return n;
|
|
8766
8766
|
const i = __PRIVATE_fieldIndexGetArraySegment(t);
|
|
8767
8767
|
if (null != i) {
|
|
@@ -8910,7 +8910,7 @@ function __PRIVATE_getMinOffsetFromFieldIndexes(e) {
|
|
|
8910
8910
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8911
8911
|
* See the License for the specific language governing permissions and
|
|
8912
8912
|
* limitations under the License.
|
|
8913
|
-
*/ const
|
|
8913
|
+
*/ const de = {
|
|
8914
8914
|
didRun: !1,
|
|
8915
8915
|
sequenceNumbersCollected: 0,
|
|
8916
8916
|
targetsRemoved: 0,
|
|
@@ -9643,8 +9643,8 @@ class __PRIVATE_TargetIdGenerator {
|
|
|
9643
9643
|
}
|
|
9644
9644
|
collect(e, t) {
|
|
9645
9645
|
return -1 === this.params.cacheSizeCollectionThreshold ? (__PRIVATE_logDebug("LruGarbageCollector", "Garbage collection skipped; disabled"),
|
|
9646
|
-
PersistencePromise.resolve(
|
|
9647
|
-
|
|
9646
|
+
PersistencePromise.resolve(de)) : this.getCacheSize(e).next((n => n < this.params.cacheSizeCollectionThreshold ? (__PRIVATE_logDebug("LruGarbageCollector", `Garbage collection skipped; Cache size ${n} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),
|
|
9647
|
+
de) : this.Jn(e, t)));
|
|
9648
9648
|
}
|
|
9649
9649
|
getCacheSize(e) {
|
|
9650
9650
|
return this.zn.getCacheSize(e);
|
|
@@ -10695,14 +10695,14 @@ class OverlayedDocument {
|
|
|
10695
10695
|
const n = new __PRIVATE_DocReference(e, t);
|
|
10696
10696
|
this.hr = this.hr.add(n), this.Ir = this.Ir.add(n);
|
|
10697
10697
|
}
|
|
10698
|
-
/** Add references to the given document keys for the given ID. */
|
|
10698
|
+
/** Add references to the given document keys for the given ID. */ dr(e, t) {
|
|
10699
10699
|
e.forEach((e => this.addReference(e, t)));
|
|
10700
10700
|
}
|
|
10701
10701
|
/**
|
|
10702
10702
|
* Removes a reference to the given document key for the given
|
|
10703
10703
|
* ID.
|
|
10704
10704
|
*/ removeReference(e, t) {
|
|
10705
|
-
this.
|
|
10705
|
+
this.Er(new __PRIVATE_DocReference(e, t));
|
|
10706
10706
|
}
|
|
10707
10707
|
Ar(e, t) {
|
|
10708
10708
|
e.forEach((e => this.removeReference(e, t)));
|
|
@@ -10713,13 +10713,13 @@ class OverlayedDocument {
|
|
|
10713
10713
|
*/ Rr(e) {
|
|
10714
10714
|
const t = new DocumentKey(new ResourcePath([])), n = new __PRIVATE_DocReference(t, e), r = new __PRIVATE_DocReference(t, e + 1), i = [];
|
|
10715
10715
|
return this.Ir.forEachInRange([ n, r ], (e => {
|
|
10716
|
-
this.
|
|
10716
|
+
this.Er(e), i.push(e.key);
|
|
10717
10717
|
})), i;
|
|
10718
10718
|
}
|
|
10719
10719
|
Vr() {
|
|
10720
|
-
this.hr.forEach((e => this.
|
|
10720
|
+
this.hr.forEach((e => this.Er(e)));
|
|
10721
10721
|
}
|
|
10722
|
-
|
|
10722
|
+
Er(e) {
|
|
10723
10723
|
this.hr = this.hr.delete(e), this.Ir = this.Ir.delete(e);
|
|
10724
10724
|
}
|
|
10725
10725
|
mr(e) {
|
|
@@ -11121,7 +11121,7 @@ class __PRIVATE_MemoryRemoteDocumentChangeBuffer extends RemoteDocumentChangeBuf
|
|
|
11121
11121
|
return PersistencePromise.resolve(n);
|
|
11122
11122
|
}
|
|
11123
11123
|
addMatchingKeys(e, t, n) {
|
|
11124
|
-
return this.Or.
|
|
11124
|
+
return this.Or.dr(t, n), PersistencePromise.resolve();
|
|
11125
11125
|
}
|
|
11126
11126
|
removeMatchingKeys(e, t, n) {
|
|
11127
11127
|
this.Or.Ar(t, n);
|
|
@@ -11659,7 +11659,7 @@ function __PRIVATE_createQueryCache(e) {
|
|
|
11659
11659
|
}), e.createObjectStore("targetGlobal");
|
|
11660
11660
|
}
|
|
11661
11661
|
|
|
11662
|
-
const
|
|
11662
|
+
const Ee = "Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.";
|
|
11663
11663
|
|
|
11664
11664
|
/**
|
|
11665
11665
|
* Oldest acceptable age in milliseconds for client metadata before the client
|
|
@@ -11740,7 +11740,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11740
11740
|
this.serializer = new __PRIVATE_LocalSerializer(_), this.Ti = new __PRIVATE_SimpleDb(this.Ii, this.ai, new __PRIVATE_SchemaConverter(this.serializer)),
|
|
11741
11741
|
this.qr = new __PRIVATE_IndexedDbTargetCache(this.referenceDelegate, this.serializer),
|
|
11742
11742
|
this.remoteDocumentCache = __PRIVATE_newIndexedDbRemoteDocumentCache(this.serializer),
|
|
11743
|
-
this.Kr = new __PRIVATE_IndexedDbBundleCache, this.window && this.window.localStorage ? this.
|
|
11743
|
+
this.Kr = new __PRIVATE_IndexedDbBundleCache, this.window && this.window.localStorage ? this.di = this.window.localStorage : (this.di = null,
|
|
11744
11744
|
!1 === u && __PRIVATE_logError("IndexedDbPersistence", "LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."));
|
|
11745
11745
|
}
|
|
11746
11746
|
/**
|
|
@@ -11751,11 +11751,11 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11751
11751
|
// NOTE: This is expected to fail sometimes (in the case of another tab
|
|
11752
11752
|
// already having the persistence lock), so it's the first thing we should
|
|
11753
11753
|
// do.
|
|
11754
|
-
return this.
|
|
11754
|
+
return this.Ei().then((() => {
|
|
11755
11755
|
if (!this.isPrimary && !this.allowTabSynchronization)
|
|
11756
11756
|
// Fail `start()` if `synchronizeTabs` is disabled and we cannot
|
|
11757
11757
|
// obtain the primary lease.
|
|
11758
|
-
throw new FirestoreError(D.FAILED_PRECONDITION,
|
|
11758
|
+
throw new FirestoreError(D.FAILED_PRECONDITION, Ee);
|
|
11759
11759
|
return this.Ai(), this.Ri(), this.Vi(), this.runTransaction("getHighestListenSequenceNumber", "readonly", (e => this.qr.getHighestSequenceNumber(e)));
|
|
11760
11760
|
})).then((e => {
|
|
11761
11761
|
this.Lr = new __PRIVATE_ListenSequence(e, this.oi);
|
|
@@ -11795,7 +11795,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11795
11795
|
// Schedule a primary lease refresh for immediate execution. The eventual
|
|
11796
11796
|
// lease update will be propagated via `primaryStateListener`.
|
|
11797
11797
|
this.si.enqueueAndForget((async () => {
|
|
11798
|
-
this.started && await this.
|
|
11798
|
+
this.started && await this.Ei();
|
|
11799
11799
|
})));
|
|
11800
11800
|
}
|
|
11801
11801
|
/**
|
|
@@ -11803,7 +11803,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11803
11803
|
* extend the primary lease for the local client. Asynchronously notifies the
|
|
11804
11804
|
* primary state listener if the client either newly obtained or released its
|
|
11805
11805
|
* primary lease.
|
|
11806
|
-
*/
|
|
11806
|
+
*/ Ei() {
|
|
11807
11807
|
return this.runTransaction("updateClientMetadataAndTryBecomePrimary", "readwrite", (e => __PRIVATE_clientMetadataStore(e).put({
|
|
11808
11808
|
clientId: this.clientId,
|
|
11809
11809
|
updateTimeMs: Date.now(),
|
|
@@ -11852,14 +11852,14 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11852
11852
|
// Ideally we'd delete the IndexedDb and LocalStorage zombie entries for
|
|
11853
11853
|
// the client atomically, but we can't. So we opt to delete the IndexedDb
|
|
11854
11854
|
// entries first to avoid potentially reviving a zombied client.
|
|
11855
|
-
if (this.
|
|
11855
|
+
if (this.di) for (const t of e) this.di.removeItem(this.vi(t.clientId));
|
|
11856
11856
|
}
|
|
11857
11857
|
}
|
|
11858
11858
|
/**
|
|
11859
11859
|
* Schedules a recurring timer to update the client metadata and to either
|
|
11860
11860
|
* extend or acquire the primary lease if the client is eligible.
|
|
11861
11861
|
*/ Vi() {
|
|
11862
|
-
this.li = this.si.enqueueAfterDelay("client_metadata_refresh" /* TimerId.ClientMetadataRefresh */ , 4e3, (() => this.
|
|
11862
|
+
this.li = this.si.enqueueAfterDelay("client_metadata_refresh" /* TimerId.ClientMetadataRefresh */ , 4e3, (() => this.Ei().then((() => this.bi())).then((() => this.Vi()))));
|
|
11863
11863
|
}
|
|
11864
11864
|
/** Checks whether `client` is the local client. */ wi(e) {
|
|
11865
11865
|
return !!e && e.ownerId === this.clientId;
|
|
@@ -11897,7 +11897,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11897
11897
|
// settings is not supported.
|
|
11898
11898
|
// TODO(b/114226234): Remove this check when `synchronizeTabs` can
|
|
11899
11899
|
// no longer be turned off.
|
|
11900
|
-
throw new FirestoreError(D.FAILED_PRECONDITION,
|
|
11900
|
+
throw new FirestoreError(D.FAILED_PRECONDITION, Ee);
|
|
11901
11901
|
return !1;
|
|
11902
11902
|
}
|
|
11903
11903
|
}
|
|
@@ -11988,7 +11988,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11988
11988
|
// be turned off.
|
|
11989
11989
|
Li(e) {
|
|
11990
11990
|
return __PRIVATE_primaryClientStore(e).get("owner").next((e => {
|
|
11991
|
-
if (null !== e && this.Di(e.leaseTimestampMs, 5e3) && !this.Fi(e.ownerId) && !this.wi(e) && !(this._i || this.allowTabSynchronization && e.allowTabSynchronization)) throw new FirestoreError(D.FAILED_PRECONDITION,
|
|
11991
|
+
if (null !== e && this.Di(e.leaseTimestampMs, 5e3) && !this.Fi(e.ownerId) && !this.wi(e) && !(this._i || this.allowTabSynchronization && e.allowTabSynchronization)) throw new FirestoreError(D.FAILED_PRECONDITION, Ee);
|
|
11992
11992
|
}));
|
|
11993
11993
|
}
|
|
11994
11994
|
/**
|
|
@@ -12018,7 +12018,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12018
12018
|
Ai() {
|
|
12019
12019
|
null !== this.document && "function" == typeof this.document.addEventListener && (this.ci = () => {
|
|
12020
12020
|
this.si.enqueueAndForget((() => (this.inForeground = "visible" === this.document.visibilityState,
|
|
12021
|
-
this.
|
|
12021
|
+
this.Ei())));
|
|
12022
12022
|
}, this.document.addEventListener("visibilitychange", this.ci), this.inForeground = "visible" === this.document.visibilityState);
|
|
12023
12023
|
}
|
|
12024
12024
|
xi() {
|
|
@@ -12059,7 +12059,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12059
12059
|
*/ Fi(e) {
|
|
12060
12060
|
var t;
|
|
12061
12061
|
try {
|
|
12062
|
-
const n = null !== (null === (t = this.
|
|
12062
|
+
const n = null !== (null === (t = this.di) || void 0 === t ? void 0 : t.getItem(this.vi(e)));
|
|
12063
12063
|
return __PRIVATE_logDebug("IndexedDbPersistence", `Client '${e}' ${n ? "is" : "is not"} zombied in LocalStorage`),
|
|
12064
12064
|
n;
|
|
12065
12065
|
} catch (e) {
|
|
@@ -12072,16 +12072,16 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12072
12072
|
* Record client as zombied (a client that had its tab closed). Zombied
|
|
12073
12073
|
* clients are ignored during primary tab selection.
|
|
12074
12074
|
*/ Mi() {
|
|
12075
|
-
if (this.
|
|
12076
|
-
this.
|
|
12075
|
+
if (this.di) try {
|
|
12076
|
+
this.di.setItem(this.vi(this.clientId), String(Date.now()));
|
|
12077
12077
|
} catch (e) {
|
|
12078
12078
|
// Gracefully handle if LocalStorage isn't available / working.
|
|
12079
12079
|
__PRIVATE_logError("Failed to set zombie client id.", e);
|
|
12080
12080
|
}
|
|
12081
12081
|
}
|
|
12082
12082
|
/** Removes the zombied client entry if it exists. */ Ni() {
|
|
12083
|
-
if (this.
|
|
12084
|
-
this.
|
|
12083
|
+
if (this.di) try {
|
|
12084
|
+
this.di.removeItem(this.vi(this.clientId));
|
|
12085
12085
|
} catch (e) {
|
|
12086
12086
|
// Ignore
|
|
12087
12087
|
}
|
|
@@ -12895,7 +12895,7 @@ class __PRIVATE_MutationMetadata {
|
|
|
12895
12895
|
s && (i = new FirestoreError(r.error.code, r.error.message))), s ? new __PRIVATE_MutationMetadata(e, t, r.state, i) : (__PRIVATE_logError("SharedClientState", `Failed to parse mutation state for ID '${t}': ${n}`),
|
|
12896
12896
|
null);
|
|
12897
12897
|
}
|
|
12898
|
-
|
|
12898
|
+
ds() {
|
|
12899
12899
|
const e = {
|
|
12900
12900
|
state: this.state,
|
|
12901
12901
|
updateTimeMs: Date.now()
|
|
@@ -12926,7 +12926,7 @@ class __PRIVATE_QueryTargetMetadata {
|
|
|
12926
12926
|
i && (r = new FirestoreError(n.error.code, n.error.message))), i ? new __PRIVATE_QueryTargetMetadata(e, n.state, r) : (__PRIVATE_logError("SharedClientState", `Failed to parse target state for ID '${e}': ${t}`),
|
|
12927
12927
|
null);
|
|
12928
12928
|
}
|
|
12929
|
-
|
|
12929
|
+
ds() {
|
|
12930
12930
|
const e = {
|
|
12931
12931
|
state: this.state,
|
|
12932
12932
|
updateTimeMs: Date.now()
|
|
@@ -12991,7 +12991,7 @@ class __PRIVATE_LocalClientState {
|
|
|
12991
12991
|
constructor() {
|
|
12992
12992
|
this.activeTargetIds = __PRIVATE_targetIdSet();
|
|
12993
12993
|
}
|
|
12994
|
-
|
|
12994
|
+
Es(e) {
|
|
12995
12995
|
this.activeTargetIds = this.activeTargetIds.add(e);
|
|
12996
12996
|
}
|
|
12997
12997
|
As(e) {
|
|
@@ -13000,7 +13000,7 @@ class __PRIVATE_LocalClientState {
|
|
|
13000
13000
|
/**
|
|
13001
13001
|
* Converts this entry into a JSON-encoded format we can use for WebStorage.
|
|
13002
13002
|
* Does not encode `clientId` as it is part of the key in WebStorage.
|
|
13003
|
-
*/
|
|
13003
|
+
*/ ds() {
|
|
13004
13004
|
const e = {
|
|
13005
13005
|
activeTargetIds: this.activeTargetIds.toArray(),
|
|
13006
13006
|
updateTimeMs: Date.now()
|
|
@@ -13135,7 +13135,7 @@ class __PRIVATE_LocalClientState {
|
|
|
13135
13135
|
r && (t = r.state);
|
|
13136
13136
|
}
|
|
13137
13137
|
}
|
|
13138
|
-
return this.Ls.
|
|
13138
|
+
return this.Ls.Es(e), this.Fs(), t;
|
|
13139
13139
|
}
|
|
13140
13140
|
removeLocalQueryTarget(e) {
|
|
13141
13141
|
this.Ls.As(e), this.Fs();
|
|
@@ -13237,11 +13237,11 @@ class __PRIVATE_LocalClientState {
|
|
|
13237
13237
|
return this.gs.get(this.Rs);
|
|
13238
13238
|
}
|
|
13239
13239
|
Fs() {
|
|
13240
|
-
this.setItem(this.ys, this.Ls.
|
|
13240
|
+
this.setItem(this.ys, this.Ls.ds());
|
|
13241
13241
|
}
|
|
13242
13242
|
Ns(e, t, n) {
|
|
13243
13243
|
const r = new __PRIVATE_MutationMetadata(this.currentUser, e, t, n), i = createWebStorageMutationBatchKey(this.persistenceKey, this.currentUser, e);
|
|
13244
|
-
this.setItem(i, r.
|
|
13244
|
+
this.setItem(i, r.ds());
|
|
13245
13245
|
}
|
|
13246
13246
|
Bs(e) {
|
|
13247
13247
|
const t = createWebStorageMutationBatchKey(this.persistenceKey, this.currentUser, e);
|
|
@@ -13256,7 +13256,7 @@ class __PRIVATE_LocalClientState {
|
|
|
13256
13256
|
}
|
|
13257
13257
|
ks(e, t, n) {
|
|
13258
13258
|
const r = createWebStorageQueryTargetMetadataKey(this.persistenceKey, e), i = new __PRIVATE_QueryTargetMetadata(e, t, n);
|
|
13259
|
-
this.setItem(r, i.
|
|
13259
|
+
this.setItem(r, i.ds());
|
|
13260
13260
|
}
|
|
13261
13261
|
Qs(e) {
|
|
13262
13262
|
const t = JSON.stringify(Array.from(e));
|
|
@@ -13344,7 +13344,7 @@ class __PRIVATE_MemorySharedClientState {
|
|
|
13344
13344
|
// No op.
|
|
13345
13345
|
}
|
|
13346
13346
|
addLocalQueryTarget(e) {
|
|
13347
|
-
return this.eo.
|
|
13347
|
+
return this.eo.Es(e), this.no[e] || "not-current";
|
|
13348
13348
|
}
|
|
13349
13349
|
updateQueryState(e, t, n) {
|
|
13350
13350
|
this.no[e] = t;
|
|
@@ -14358,7 +14358,7 @@ class __PRIVATE_PersistentStream {
|
|
|
14358
14358
|
* Sends an initial streamToken to the server, performing the handshake
|
|
14359
14359
|
* required to make the StreamingWrite RPC work. Subsequent
|
|
14360
14360
|
* calls should wait until onHandshakeComplete was called.
|
|
14361
|
-
*/
|
|
14361
|
+
*/ d_() {
|
|
14362
14362
|
// TODO(dimond): Support stream resumption. We intentionally do not set the
|
|
14363
14363
|
// stream token on the handshake, ignoring any stream token we might have.
|
|
14364
14364
|
const e = {};
|
|
@@ -14401,10 +14401,10 @@ class __PRIVATE_PersistentStream {
|
|
|
14401
14401
|
class __PRIVATE_DatastoreImpl extends class Datastore {} {
|
|
14402
14402
|
constructor(e, t, n, r) {
|
|
14403
14403
|
super(), this.authCredentials = e, this.appCheckCredentials = t, this.connection = n,
|
|
14404
|
-
this.serializer = r, this.
|
|
14404
|
+
this.serializer = r, this.E_ = !1;
|
|
14405
14405
|
}
|
|
14406
14406
|
A_() {
|
|
14407
|
-
if (this.
|
|
14407
|
+
if (this.E_) throw new FirestoreError(D.FAILED_PRECONDITION, "The client has already been terminated.");
|
|
14408
14408
|
}
|
|
14409
14409
|
/** Invokes the provided RPC with auth and AppCheck tokens. */ wo(e, t, n) {
|
|
14410
14410
|
return this.A_(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([r, i]) => this.connection.wo(e, t, n, r, i))).catch((e => {
|
|
@@ -14419,7 +14419,7 @@ class __PRIVATE_DatastoreImpl extends class Datastore {} {
|
|
|
14419
14419
|
}));
|
|
14420
14420
|
}
|
|
14421
14421
|
terminate() {
|
|
14422
|
-
this.
|
|
14422
|
+
this.E_ = !0, this.connection.terminate();
|
|
14423
14423
|
}
|
|
14424
14424
|
}
|
|
14425
14425
|
|
|
@@ -14879,7 +14879,7 @@ function __PRIVATE_startWriteStream(e) {
|
|
|
14879
14879
|
}
|
|
14880
14880
|
|
|
14881
14881
|
async function __PRIVATE_onWriteStreamOpen(e) {
|
|
14882
|
-
__PRIVATE_ensureWriteStream(e).
|
|
14882
|
+
__PRIVATE_ensureWriteStream(e).d_();
|
|
14883
14883
|
}
|
|
14884
14884
|
|
|
14885
14885
|
async function __PRIVATE_onWriteHandshakeComplete(e) {
|
|
@@ -15811,7 +15811,7 @@ class __PRIVATE_RemovedLimboDocument {
|
|
|
15811
15811
|
}
|
|
15812
15812
|
/**
|
|
15813
15813
|
* Returns whether the doc for the given key should be in limbo.
|
|
15814
|
-
*/
|
|
15814
|
+
*/ da(e) {
|
|
15815
15815
|
// If the remote end says it's part of this query, it's not in limbo.
|
|
15816
15816
|
return !this.ia.has(e) && (
|
|
15817
15817
|
// The local store doesn't think it's a result, so it shouldn't be in limbo.
|
|
@@ -15831,7 +15831,7 @@ class __PRIVATE_RemovedLimboDocument {
|
|
|
15831
15831
|
// updating many documents.
|
|
15832
15832
|
const e = this.oa;
|
|
15833
15833
|
this.oa = __PRIVATE_documentKeySet(), this.aa.forEach((e => {
|
|
15834
|
-
this.
|
|
15834
|
+
this.da(e.key) && (this.oa = this.oa.add(e.key));
|
|
15835
15835
|
}));
|
|
15836
15836
|
// Diff the new limbo docs with the old limbo docs.
|
|
15837
15837
|
const t = [];
|
|
@@ -15861,7 +15861,7 @@ class __PRIVATE_RemovedLimboDocument {
|
|
|
15861
15861
|
* @returns The ViewChange that resulted from this synchronization.
|
|
15862
15862
|
*/
|
|
15863
15863
|
// PORTING NOTE: Multi-tab only.
|
|
15864
|
-
|
|
15864
|
+
Ea(e) {
|
|
15865
15865
|
this.ia = e.ls, this.oa = __PRIVATE_documentKeySet();
|
|
15866
15866
|
const t = this.ca(e.documents);
|
|
15867
15867
|
return this.applyChanges(t, /* limboResolutionEnabled= */ !0);
|
|
@@ -16416,7 +16416,7 @@ function __PRIVATE_syncEngineGetRemoteKeysForTarget(e, t) {
|
|
|
16416
16416
|
* from persistence.
|
|
16417
16417
|
*/ async function __PRIVATE_synchronizeViewAndComputeSnapshot(e, t) {
|
|
16418
16418
|
const n = __PRIVATE_debugCast(e), r = await __PRIVATE_localStoreExecuteQuery(n.localStore, t.query,
|
|
16419
|
-
/* usePreviousResults= */ !0), i = t.view.
|
|
16419
|
+
/* usePreviousResults= */ !0), i = t.view.Ea(r);
|
|
16420
16420
|
return n.isPrimaryClient && __PRIVATE_updateTrackedLimbos(n, t.targetId, i.Ta),
|
|
16421
16421
|
i;
|
|
16422
16422
|
}
|
|
@@ -19285,11 +19285,11 @@ function __PRIVATE_isWrite(e) {
|
|
|
19285
19285
|
/** Returns a new context with the specified settings overwritten. */ Tu(e) {
|
|
19286
19286
|
return new __PRIVATE_ParseContextImpl(Object.assign(Object.assign({}, this.settings), e), this.databaseId, this.serializer, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);
|
|
19287
19287
|
}
|
|
19288
|
-
|
|
19288
|
+
du(e) {
|
|
19289
19289
|
var t;
|
|
19290
19290
|
const n = null === (t = this.path) || void 0 === t ? void 0 : t.child(e), r = this.Tu({
|
|
19291
19291
|
path: n,
|
|
19292
|
-
|
|
19292
|
+
Eu: !1
|
|
19293
19293
|
});
|
|
19294
19294
|
return r.Au(e), r;
|
|
19295
19295
|
}
|
|
@@ -19297,7 +19297,7 @@ function __PRIVATE_isWrite(e) {
|
|
|
19297
19297
|
var t;
|
|
19298
19298
|
const n = null === (t = this.path) || void 0 === t ? void 0 : t.child(e), r = this.Tu({
|
|
19299
19299
|
path: n,
|
|
19300
|
-
|
|
19300
|
+
Eu: !1
|
|
19301
19301
|
});
|
|
19302
19302
|
return r.Pu(), r;
|
|
19303
19303
|
}
|
|
@@ -19306,7 +19306,7 @@ function __PRIVATE_isWrite(e) {
|
|
|
19306
19306
|
// undefined.
|
|
19307
19307
|
return this.Tu({
|
|
19308
19308
|
path: void 0,
|
|
19309
|
-
|
|
19309
|
+
Eu: !0
|
|
19310
19310
|
});
|
|
19311
19311
|
}
|
|
19312
19312
|
mu(e) {
|
|
@@ -19339,7 +19339,7 @@ function __PRIVATE_isWrite(e) {
|
|
|
19339
19339
|
methodName: t,
|
|
19340
19340
|
gu: n,
|
|
19341
19341
|
path: FieldPath$1.emptyPath(),
|
|
19342
|
-
|
|
19342
|
+
Eu: !1,
|
|
19343
19343
|
fu: r
|
|
19344
19344
|
}, this.databaseId, this.serializer, this.ignoreUndefinedProperties);
|
|
19345
19345
|
}
|
|
@@ -19399,7 +19399,7 @@ class __PRIVATE_DeleteFieldValueImpl extends FieldValue {
|
|
|
19399
19399
|
Iu: 3 /* UserDataSource.Argument */ ,
|
|
19400
19400
|
gu: t.settings.gu,
|
|
19401
19401
|
methodName: e._methodName,
|
|
19402
|
-
|
|
19402
|
+
Eu: n
|
|
19403
19403
|
}, t.databaseId, t.serializer, t.ignoreUndefinedProperties);
|
|
19404
19404
|
}
|
|
19405
19405
|
|
|
@@ -19561,7 +19561,7 @@ class __PRIVATE_NumericIncrementFieldValueImpl extends FieldValue {
|
|
|
19561
19561
|
// the set of values to be included for the IN query) that may directly
|
|
19562
19562
|
// contain additional arrays (each representing an individual field
|
|
19563
19563
|
// value), so we disable this validation.
|
|
19564
|
-
if (t.settings.
|
|
19564
|
+
if (t.settings.Eu && 4 /* UserDataSource.ArrayArgument */ !== t.Iu) throw t.mu("Nested arrays are not supported");
|
|
19565
19565
|
return function __PRIVATE_parseArray(e, t) {
|
|
19566
19566
|
const n = [];
|
|
19567
19567
|
let r = 0;
|
|
@@ -19640,7 +19640,7 @@ function __PRIVATE_parseObject(e, t) {
|
|
|
19640
19640
|
// If we encounter an empty object, we explicitly add it to the update
|
|
19641
19641
|
// mask to ensure that the server creates a map entry.
|
|
19642
19642
|
t.path && t.path.length > 0 && t.fieldMask.push(t.path) : forEach(e, ((e, r) => {
|
|
19643
|
-
const i = __PRIVATE_parseData(r, t.
|
|
19643
|
+
const i = __PRIVATE_parseData(r, t.du(e));
|
|
19644
19644
|
null != i && (n[e] = i);
|
|
19645
19645
|
})), {
|
|
19646
19646
|
mapValue: {
|
|
@@ -21800,9 +21800,9 @@ let Se = null;
|
|
|
21800
21800
|
return r = Object.assign({
|
|
21801
21801
|
useFetchStreams: t
|
|
21802
21802
|
}, r), s._setSettings(r), s;
|
|
21803
|
-
}), "PUBLIC").setMultipleInstances(!0)), app.registerVersion(w, "4.4.0-canary.
|
|
21803
|
+
}), "PUBLIC").setMultipleInstances(!0)), app.registerVersion(w, "4.4.0-canary.50b2182d7", e),
|
|
21804
21804
|
// BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
|
|
21805
|
-
app.registerVersion(w, "4.4.0-canary.
|
|
21805
|
+
app.registerVersion(w, "4.4.0-canary.50b2182d7", "cjs2017");
|
|
21806
21806
|
}();
|
|
21807
21807
|
|
|
21808
21808
|
exports.AbstractUserDataWriter = AbstractUserDataWriter;
|