@firebase/firestore 4.7.1-canary.15c36cc7a → 4.7.1-canary.16d62d4fa
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 +84 -84
- package/dist/index.esm2017.js +84 -84
- package/dist/index.esm5.js +79 -79
- package/dist/index.node.cjs.js +2 -2
- package/dist/index.node.mjs +2 -2
- package/dist/index.rn.js +92 -92
- 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 +9 -9
- package/package.json +17 -17
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.
|
|
74
|
+
let b = "10.13.1-canary.16d62d4fa";
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* @license
|
|
@@ -5895,7 +5895,7 @@ class BloomFilter {
|
|
|
5895
5895
|
}
|
|
5896
5896
|
// Calculate the ith hash value based on the hashed 64bit integers,
|
|
5897
5897
|
// and calculate its corresponding bit index in the bitmap to be checked.
|
|
5898
|
-
|
|
5898
|
+
de(e, t, n) {
|
|
5899
5899
|
// Calculate hashed value h(i) = h1 + (i * h2).
|
|
5900
5900
|
let r = e.add(t.multiply(bloomBlob.Integer.fromNumber(n)));
|
|
5901
5901
|
// Wrap if hash value overflow 64bit.
|
|
@@ -5903,7 +5903,7 @@ class BloomFilter {
|
|
|
5903
5903
|
r.modulo(this.Te).toNumber();
|
|
5904
5904
|
}
|
|
5905
5905
|
// Return whether the bit on the given index in the bitmap is set to 1.
|
|
5906
|
-
|
|
5906
|
+
Ee(e) {
|
|
5907
5907
|
return 0 != (this.bitmap[Math.floor(e / 8)] & 1 << e % 8);
|
|
5908
5908
|
}
|
|
5909
5909
|
mightContain(e) {
|
|
@@ -5911,8 +5911,8 @@ class BloomFilter {
|
|
|
5911
5911
|
if (0 === this.Ie) return !1;
|
|
5912
5912
|
const t = __PRIVATE_getMd5HashValue(e), [n, r] = __PRIVATE_get64BitUints(t);
|
|
5913
5913
|
for (let e = 0; e < this.hashCount; e++) {
|
|
5914
|
-
const t = this.
|
|
5915
|
-
if (!this.
|
|
5914
|
+
const t = this.de(n, r, e);
|
|
5915
|
+
if (!this.Ee(t)) return !1;
|
|
5916
5916
|
}
|
|
5917
5917
|
return !0;
|
|
5918
5918
|
}
|
|
@@ -5924,7 +5924,7 @@ class BloomFilter {
|
|
|
5924
5924
|
if (0 === this.Ie) return;
|
|
5925
5925
|
const t = __PRIVATE_getMd5HashValue(e), [n, r] = __PRIVATE_get64BitUints(t);
|
|
5926
5926
|
for (let e = 0; e < this.hashCount; e++) {
|
|
5927
|
-
const t = this.
|
|
5927
|
+
const t = this.de(n, r, e);
|
|
5928
5928
|
this.Ae(t);
|
|
5929
5929
|
}
|
|
5930
5930
|
}
|
|
@@ -6533,13 +6533,13 @@ function __PRIVATE_snapshotChangesMap() {
|
|
|
6533
6533
|
return new SortedMap(DocumentKey.comparator);
|
|
6534
6534
|
}
|
|
6535
6535
|
|
|
6536
|
-
const
|
|
6536
|
+
const de = (() => {
|
|
6537
6537
|
const e = {
|
|
6538
6538
|
asc: "ASCENDING",
|
|
6539
6539
|
desc: "DESCENDING"
|
|
6540
6540
|
};
|
|
6541
6541
|
return e;
|
|
6542
|
-
})(),
|
|
6542
|
+
})(), Ee = (() => {
|
|
6543
6543
|
const e = {
|
|
6544
6544
|
"<": "LESS_THAN",
|
|
6545
6545
|
"<=": "LESS_THAN_OR_EQUAL",
|
|
@@ -7125,11 +7125,11 @@ function __PRIVATE_fromFilter(e) {
|
|
|
7125
7125
|
}
|
|
7126
7126
|
|
|
7127
7127
|
function __PRIVATE_toDirection(e) {
|
|
7128
|
-
return
|
|
7128
|
+
return de[e];
|
|
7129
7129
|
}
|
|
7130
7130
|
|
|
7131
7131
|
function __PRIVATE_toOperatorName(e) {
|
|
7132
|
-
return
|
|
7132
|
+
return Ee[e];
|
|
7133
7133
|
}
|
|
7134
7134
|
|
|
7135
7135
|
function __PRIVATE_toCompositeOperatorName(e) {
|
|
@@ -7714,59 +7714,59 @@ class __PRIVATE_FirestoreIndexValueWriter {
|
|
|
7714
7714
|
this.Tt(e, t),
|
|
7715
7715
|
// Write separator to split index values
|
|
7716
7716
|
// (see go/firestore-storage-format#encodings).
|
|
7717
|
-
t.
|
|
7717
|
+
t.dt();
|
|
7718
7718
|
}
|
|
7719
7719
|
Tt(e, t) {
|
|
7720
|
-
if ("nullValue" in e) this.
|
|
7721
|
-
t.At(e.booleanValue ? 1 : 0); else if ("integerValue" in e) this.
|
|
7720
|
+
if ("nullValue" in e) this.Et(t, 5); else if ("booleanValue" in e) this.Et(t, 10),
|
|
7721
|
+
t.At(e.booleanValue ? 1 : 0); else if ("integerValue" in e) this.Et(t, 15), t.At(__PRIVATE_normalizeNumber(e.integerValue)); else if ("doubleValue" in e) {
|
|
7722
7722
|
const n = __PRIVATE_normalizeNumber(e.doubleValue);
|
|
7723
|
-
isNaN(n) ? this.
|
|
7723
|
+
isNaN(n) ? this.Et(t, 13) : (this.Et(t, 15), __PRIVATE_isNegativeZero(n) ?
|
|
7724
7724
|
// -0.0, 0 and 0.0 are all considered the same
|
|
7725
7725
|
t.At(0) : t.At(n));
|
|
7726
7726
|
} else if ("timestampValue" in e) {
|
|
7727
7727
|
let n = e.timestampValue;
|
|
7728
|
-
this.
|
|
7728
|
+
this.Et(t, 20), "string" == typeof n && (n = __PRIVATE_normalizeTimestamp(n)), t.Rt(`${n.seconds || ""}`),
|
|
7729
7729
|
t.At(n.nanos || 0);
|
|
7730
|
-
} else if ("stringValue" in e) this.Vt(e.stringValue, t), this.ft(t); else if ("bytesValue" in e) this.
|
|
7730
|
+
} else if ("stringValue" in e) this.Vt(e.stringValue, t), this.ft(t); else if ("bytesValue" in e) this.Et(t, 30),
|
|
7731
7731
|
t.gt(__PRIVATE_normalizeByteString(e.bytesValue)), this.ft(t); else if ("referenceValue" in e) this.yt(e.referenceValue, t); else if ("geoPointValue" in e) {
|
|
7732
7732
|
const n = e.geoPointValue;
|
|
7733
|
-
this.
|
|
7734
|
-
} else "mapValue" in e ? __PRIVATE_isMaxValue(e) ? this.
|
|
7733
|
+
this.Et(t, 45), t.At(n.latitude || 0), t.At(n.longitude || 0);
|
|
7734
|
+
} else "mapValue" in e ? __PRIVATE_isMaxValue(e) ? this.Et(t, Number.MAX_SAFE_INTEGER) : __PRIVATE_isVectorValue(e) ? this.wt(e.mapValue, t) : (this.St(e.mapValue, t),
|
|
7735
7735
|
this.ft(t)) : "arrayValue" in e ? (this.bt(e.arrayValue, t), this.ft(t)) : fail();
|
|
7736
7736
|
}
|
|
7737
7737
|
Vt(e, t) {
|
|
7738
|
-
this.
|
|
7738
|
+
this.Et(t, 25), this.Dt(e, t);
|
|
7739
7739
|
}
|
|
7740
7740
|
Dt(e, t) {
|
|
7741
7741
|
t.Rt(e);
|
|
7742
7742
|
}
|
|
7743
7743
|
St(e, t) {
|
|
7744
7744
|
const n = e.fields || {};
|
|
7745
|
-
this.
|
|
7745
|
+
this.Et(t, 55);
|
|
7746
7746
|
for (const e of Object.keys(n)) this.Vt(e, t), this.Tt(n[e], t);
|
|
7747
7747
|
}
|
|
7748
7748
|
wt(e, t) {
|
|
7749
7749
|
var n, r;
|
|
7750
7750
|
const i = e.fields || {};
|
|
7751
|
-
this.
|
|
7751
|
+
this.Et(t, 53);
|
|
7752
7752
|
// Vectors sort first by length
|
|
7753
7753
|
const s = "value", o = (null === (r = null === (n = i[s].arrayValue) || void 0 === n ? void 0 : n.values) || void 0 === r ? void 0 : r.length) || 0;
|
|
7754
|
-
this.
|
|
7754
|
+
this.Et(t, 15), t.At(__PRIVATE_normalizeNumber(o)),
|
|
7755
7755
|
// Vectors then sort by position value
|
|
7756
7756
|
this.Vt(s, t), this.Tt(i[s], t);
|
|
7757
7757
|
}
|
|
7758
7758
|
bt(e, t) {
|
|
7759
7759
|
const n = e.values || [];
|
|
7760
|
-
this.
|
|
7760
|
+
this.Et(t, 50);
|
|
7761
7761
|
for (const e of n) this.Tt(e, t);
|
|
7762
7762
|
}
|
|
7763
7763
|
yt(e, t) {
|
|
7764
|
-
this.
|
|
7764
|
+
this.Et(t, 37);
|
|
7765
7765
|
DocumentKey.fromName(e).path.forEach((e => {
|
|
7766
|
-
this.
|
|
7766
|
+
this.Et(t, 60), this.Dt(e, t);
|
|
7767
7767
|
}));
|
|
7768
7768
|
}
|
|
7769
|
-
|
|
7769
|
+
Et(e, t) {
|
|
7770
7770
|
e.At(t);
|
|
7771
7771
|
}
|
|
7772
7772
|
ft(e) {
|
|
@@ -7966,7 +7966,7 @@ class __PRIVATE_AscendingIndexByteEncoder {
|
|
|
7966
7966
|
At(e) {
|
|
7967
7967
|
this.jt.kt(e);
|
|
7968
7968
|
}
|
|
7969
|
-
|
|
7969
|
+
dt() {
|
|
7970
7970
|
this.jt.$t();
|
|
7971
7971
|
}
|
|
7972
7972
|
}
|
|
@@ -7984,7 +7984,7 @@ class __PRIVATE_DescendingIndexByteEncoder {
|
|
|
7984
7984
|
At(e) {
|
|
7985
7985
|
this.jt.Kt(e);
|
|
7986
7986
|
}
|
|
7987
|
-
|
|
7987
|
+
dt() {
|
|
7988
7988
|
this.jt.Wt();
|
|
7989
7989
|
}
|
|
7990
7990
|
}
|
|
@@ -8682,7 +8682,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8682
8682
|
n.push(t.value), r && (r = t.inclusive);
|
|
8683
8683
|
}
|
|
8684
8684
|
return new Bound(n, r);
|
|
8685
|
-
}(s, i), c = this.In(i, s, a), l = this.In(i, s, u), h = this.Tn(i, s, _), P = this.
|
|
8685
|
+
}(s, i), c = this.In(i, s, a), l = this.In(i, s, u), h = this.Tn(i, s, _), P = this.dn(i.indexId, o, c, a.inclusive, l, u.inclusive, h);
|
|
8686
8686
|
return PersistencePromise.forEach(P, (i => n.G(i, t.limit).next((t => {
|
|
8687
8687
|
t.forEach((t => {
|
|
8688
8688
|
const n = DocumentKey.fromSegments(t.documentKey);
|
|
@@ -8705,14 +8705,14 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8705
8705
|
/**
|
|
8706
8706
|
* Constructs a key range query on `DbIndexEntryStore` that unions all
|
|
8707
8707
|
* bounds.
|
|
8708
|
-
*/
|
|
8708
|
+
*/ dn(e, t, n, r, i, s, o) {
|
|
8709
8709
|
// The number of total index scans we union together. This is similar to a
|
|
8710
8710
|
// distributed normal form, but adapted for array values. We create a single
|
|
8711
8711
|
// index range per value in an ARRAY_CONTAINS or ARRAY_CONTAINS_ANY filter
|
|
8712
8712
|
// combined with the values from the query bounds.
|
|
8713
8713
|
const _ = (null != t ? t.length : 1) * Math.max(n.length, i.length), a = _ / (null != t ? t.length : 1), u = [];
|
|
8714
8714
|
for (let c = 0; c < _; ++c) {
|
|
8715
|
-
const _ = t ? this.
|
|
8715
|
+
const _ = t ? this.En(t[c / a]) : Re, l = this.An(e, _, n[c % a], r), h = this.Rn(e, _, i[c % a], s), P = o.map((t => this.An(e, _, t,
|
|
8716
8716
|
/* inclusive= */ !0)));
|
|
8717
8717
|
u.push(...this.createRange(l, h, P));
|
|
8718
8718
|
}
|
|
@@ -8780,7 +8780,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8780
8780
|
}
|
|
8781
8781
|
return n.zt();
|
|
8782
8782
|
}
|
|
8783
|
-
/** Encodes a single value to the ascending index format. */
|
|
8783
|
+
/** Encodes a single value to the ascending index format. */ En(e) {
|
|
8784
8784
|
const t = new __PRIVATE_IndexByteEncoder;
|
|
8785
8785
|
return __PRIVATE_FirestoreIndexValueWriter.vt.It(e, t.Yt(0 /* IndexKind.ASCENDING */)),
|
|
8786
8786
|
t.zt();
|
|
@@ -8908,7 +8908,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8908
8908
|
const i = __PRIVATE_fieldIndexGetArraySegment(t);
|
|
8909
8909
|
if (null != i) {
|
|
8910
8910
|
const s = e.data.field(i.fieldPath);
|
|
8911
|
-
if (isArray(s)) for (const i of s.arrayValue.values || []) n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key, this.
|
|
8911
|
+
if (isArray(s)) for (const i of s.arrayValue.values || []) n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key, this.En(i), r));
|
|
8912
8912
|
} else n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key, Re, r));
|
|
8913
8913
|
return n;
|
|
8914
8914
|
}
|
|
@@ -10854,16 +10854,16 @@ class OverlayedDocument {
|
|
|
10854
10854
|
*/ class __PRIVATE_ReferenceSet {
|
|
10855
10855
|
constructor() {
|
|
10856
10856
|
// A set of outstanding references to a document sorted by key.
|
|
10857
|
-
this.Tr = new SortedSet(__PRIVATE_DocReference.
|
|
10857
|
+
this.Tr = new SortedSet(__PRIVATE_DocReference.dr),
|
|
10858
10858
|
// A set of outstanding references to a document sorted by target id.
|
|
10859
|
-
this.
|
|
10859
|
+
this.Er = new SortedSet(__PRIVATE_DocReference.Ar);
|
|
10860
10860
|
}
|
|
10861
10861
|
/** Returns true if the reference set contains no references. */ isEmpty() {
|
|
10862
10862
|
return this.Tr.isEmpty();
|
|
10863
10863
|
}
|
|
10864
10864
|
/** Adds a reference to the given document key for the given ID. */ addReference(e, t) {
|
|
10865
10865
|
const n = new __PRIVATE_DocReference(e, t);
|
|
10866
|
-
this.Tr = this.Tr.add(n), this.
|
|
10866
|
+
this.Tr = this.Tr.add(n), this.Er = this.Er.add(n);
|
|
10867
10867
|
}
|
|
10868
10868
|
/** Add references to the given document keys for the given ID. */ Rr(e, t) {
|
|
10869
10869
|
e.forEach((e => this.addReference(e, t)));
|
|
@@ -10882,7 +10882,7 @@ class OverlayedDocument {
|
|
|
10882
10882
|
* removed.
|
|
10883
10883
|
*/ gr(e) {
|
|
10884
10884
|
const t = new DocumentKey(new ResourcePath([])), n = new __PRIVATE_DocReference(t, e), r = new __PRIVATE_DocReference(t, e + 1), i = [];
|
|
10885
|
-
return this.
|
|
10885
|
+
return this.Er.forEachInRange([ n, r ], (e => {
|
|
10886
10886
|
this.Vr(e), i.push(e.key);
|
|
10887
10887
|
})), i;
|
|
10888
10888
|
}
|
|
@@ -10890,12 +10890,12 @@ class OverlayedDocument {
|
|
|
10890
10890
|
this.Tr.forEach((e => this.Vr(e)));
|
|
10891
10891
|
}
|
|
10892
10892
|
Vr(e) {
|
|
10893
|
-
this.Tr = this.Tr.delete(e), this.
|
|
10893
|
+
this.Tr = this.Tr.delete(e), this.Er = this.Er.delete(e);
|
|
10894
10894
|
}
|
|
10895
10895
|
yr(e) {
|
|
10896
10896
|
const t = new DocumentKey(new ResourcePath([])), n = new __PRIVATE_DocReference(t, e), r = new __PRIVATE_DocReference(t, e + 1);
|
|
10897
10897
|
let i = __PRIVATE_documentKeySet();
|
|
10898
|
-
return this.
|
|
10898
|
+
return this.Er.forEachInRange([ n, r ], (e => {
|
|
10899
10899
|
i = i.add(e.key);
|
|
10900
10900
|
})), i;
|
|
10901
10901
|
}
|
|
@@ -10909,7 +10909,7 @@ class __PRIVATE_DocReference {
|
|
|
10909
10909
|
constructor(e, t) {
|
|
10910
10910
|
this.key = e, this.wr = t;
|
|
10911
10911
|
}
|
|
10912
|
-
/** Compare by key then by ID */ static
|
|
10912
|
+
/** Compare by key then by ID */ static dr(e, t) {
|
|
10913
10913
|
return DocumentKey.comparator(e.key, t.key) || __PRIVATE_primitiveComparator(e.wr, t.wr);
|
|
10914
10914
|
}
|
|
10915
10915
|
/** Compare by ID then by key */ static Ar(e, t) {
|
|
@@ -10943,7 +10943,7 @@ class __PRIVATE_DocReference {
|
|
|
10943
10943
|
/** Next value to use when assigning sequential IDs to each mutation batch. */
|
|
10944
10944
|
this.Sr = 1,
|
|
10945
10945
|
/** An ordered mapping between documents and the mutations batch IDs. */
|
|
10946
|
-
this.br = new SortedSet(__PRIVATE_DocReference.
|
|
10946
|
+
this.br = new SortedSet(__PRIVATE_DocReference.dr);
|
|
10947
10947
|
}
|
|
10948
10948
|
checkEmpty(e) {
|
|
10949
10949
|
return PersistencePromise.resolve(0 === this.mutationQueue.length);
|
|
@@ -11919,9 +11919,9 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11919
11919
|
/** The client metadata refresh task. */
|
|
11920
11920
|
this.Ti = null,
|
|
11921
11921
|
/** The last time we garbage collected the client metadata object store. */
|
|
11922
|
-
this.
|
|
11922
|
+
this.di = Number.NEGATIVE_INFINITY,
|
|
11923
11923
|
/** A listener to notify on primary state changes. */
|
|
11924
|
-
this.
|
|
11924
|
+
this.Ei = e => Promise.resolve(), !__PRIVATE_IndexedDbPersistence.D()) throw new FirestoreError(v.UNIMPLEMENTED, "This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");
|
|
11925
11925
|
this.referenceDelegate = new __PRIVATE_IndexedDbLruDelegateImpl(this, r), this.Ai = t + "main",
|
|
11926
11926
|
this.serializer = new __PRIVATE_LocalSerializer(_), this.Ri = new __PRIVATE_SimpleDb(this.Ai, this.hi, new __PRIVATE_SchemaConverter(this.serializer)),
|
|
11927
11927
|
this.$r = new __PRIVATE_IndexedDbGlobalsCache, this.Ur = new __PRIVATE_IndexedDbTargetCache(this.referenceDelegate, this.serializer),
|
|
@@ -11956,7 +11956,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11956
11956
|
*
|
|
11957
11957
|
* PORTING NOTE: This is only used for Web multi-tab.
|
|
11958
11958
|
*/ yi(e) {
|
|
11959
|
-
return this.
|
|
11959
|
+
return this.Ei = async t => {
|
|
11960
11960
|
if (this.started) return e(t);
|
|
11961
11961
|
}, e(this.isPrimary);
|
|
11962
11962
|
}
|
|
@@ -11997,7 +11997,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11997
11997
|
inForeground: this.inForeground
|
|
11998
11998
|
}).next((() => {
|
|
11999
11999
|
if (this.isPrimary) return this.wi(e).next((e => {
|
|
12000
|
-
e || (this.isPrimary = !1, this.ui.enqueueRetryable((() => this.
|
|
12000
|
+
e || (this.isPrimary = !1, this.ui.enqueueRetryable((() => this.Ei(!1))));
|
|
12001
12001
|
}));
|
|
12002
12002
|
})).next((() => this.Si(e))).next((t => this.isPrimary && !t ? this.bi(e).next((() => !1)) : !!t && this.Di(e).next((() => !0)))))).catch((e => {
|
|
12003
12003
|
if (__PRIVATE_isIndexedDbTransactionError(e))
|
|
@@ -12009,7 +12009,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12009
12009
|
return __PRIVATE_logDebug("IndexedDbPersistence", "Releasing owner lease after error during lease refresh", e),
|
|
12010
12010
|
/* isPrimary= */ !1;
|
|
12011
12011
|
})).then((e => {
|
|
12012
|
-
this.isPrimary !== e && this.ui.enqueueRetryable((() => this.
|
|
12012
|
+
this.isPrimary !== e && this.ui.enqueueRetryable((() => this.Ei(e))), this.isPrimary = e;
|
|
12013
12013
|
}));
|
|
12014
12014
|
}
|
|
12015
12015
|
wi(e) {
|
|
@@ -12023,8 +12023,8 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12023
12023
|
* RemoteDocumentChanges and the ClientMetadata store based on the last update
|
|
12024
12024
|
* time of all clients.
|
|
12025
12025
|
*/ async Fi() {
|
|
12026
|
-
if (this.isPrimary && !this.Mi(this.
|
|
12027
|
-
this.
|
|
12026
|
+
if (this.isPrimary && !this.Mi(this.di, 18e5)) {
|
|
12027
|
+
this.di = Date.now();
|
|
12028
12028
|
const e = await this.runTransaction("maybeGarbageCollectMultiClientState", "readwrite-primary", (e => {
|
|
12029
12029
|
const t = __PRIVATE_getStore(e, "clientMetadata");
|
|
12030
12030
|
return t.U().next((e => {
|
|
@@ -12164,7 +12164,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12164
12164
|
return this.Ri.runTransaction(e, r, i, (r => (s = new __PRIVATE_IndexedDbTransaction(r, this.Qr ? this.Qr.next() : __PRIVATE_ListenSequence.oe),
|
|
12165
12165
|
"readwrite-primary" === t ? this.wi(s).next((e => !!e || this.Si(s))).next((t => {
|
|
12166
12166
|
if (!t) throw __PRIVATE_logError(`Failed to obtain primary lease for action '${e}'.`),
|
|
12167
|
-
this.isPrimary = !1, this.ui.enqueueRetryable((() => this.
|
|
12167
|
+
this.isPrimary = !1, this.ui.enqueueRetryable((() => this.Ei(!1))), new FirestoreError(v.FAILED_PRECONDITION, F);
|
|
12168
12168
|
return n(s);
|
|
12169
12169
|
})).next((e => this.Di(s).next((() => e)))) : this.Ki(s).next((() => n(s)))))).then((e => (s.raiseOnCommittedEvent(),
|
|
12170
12170
|
e)));
|
|
@@ -13006,9 +13006,9 @@ async function __PRIVATE_localStoreApplyBundledDocuments(e, t, n, r) {
|
|
|
13006
13006
|
const i = __PRIVATE_debugCast(e);
|
|
13007
13007
|
let s = __PRIVATE_documentKeySet(), o = __PRIVATE_mutableDocumentMap();
|
|
13008
13008
|
for (const e of n) {
|
|
13009
|
-
const n = t.
|
|
13009
|
+
const n = t.ds(e.metadata.name);
|
|
13010
13010
|
e.document && (s = s.add(n));
|
|
13011
|
-
const r = t.
|
|
13011
|
+
const r = t.Es(e);
|
|
13012
13012
|
r.setReadTime(t.As(e.metadata.readTime)), o = o.insert(n, r);
|
|
13013
13013
|
}
|
|
13014
13014
|
const _ = i.cs.newChangeBuffer({
|
|
@@ -14417,7 +14417,7 @@ class __PRIVATE_PersistentStream {
|
|
|
14417
14417
|
})), this.stream.mo((e => {
|
|
14418
14418
|
n((() => this.I_(e)));
|
|
14419
14419
|
})), this.stream.onMessage((e => {
|
|
14420
|
-
n((() => 1 == ++this.e_ ? this.
|
|
14420
|
+
n((() => 1 == ++this.e_ ? this.d_(e) : this.onNext(e)));
|
|
14421
14421
|
}));
|
|
14422
14422
|
}
|
|
14423
14423
|
i_() {
|
|
@@ -14461,7 +14461,7 @@ class __PRIVATE_PersistentStream {
|
|
|
14461
14461
|
T_(e, t) {
|
|
14462
14462
|
return this.connection.Bo("Listen", e, t);
|
|
14463
14463
|
}
|
|
14464
|
-
|
|
14464
|
+
d_(e) {
|
|
14465
14465
|
return this.onNext(e);
|
|
14466
14466
|
}
|
|
14467
14467
|
onNext(e) {
|
|
@@ -14475,7 +14475,7 @@ class __PRIVATE_PersistentStream {
|
|
|
14475
14475
|
const t = e.targetChange;
|
|
14476
14476
|
return t.targetIds && t.targetIds.length ? SnapshotVersion.min() : t.readTime ? __PRIVATE_fromVersion(t.readTime) : SnapshotVersion.min();
|
|
14477
14477
|
}(e);
|
|
14478
|
-
return this.listener.
|
|
14478
|
+
return this.listener.E_(t, n);
|
|
14479
14479
|
}
|
|
14480
14480
|
/**
|
|
14481
14481
|
* Registers interest in the results of the given target. If the target
|
|
@@ -14555,7 +14555,7 @@ class __PRIVATE_PersistentStream {
|
|
|
14555
14555
|
T_(e, t) {
|
|
14556
14556
|
return this.connection.Bo("Write", e, t);
|
|
14557
14557
|
}
|
|
14558
|
-
|
|
14558
|
+
d_(e) {
|
|
14559
14559
|
// Always capture the last stream token.
|
|
14560
14560
|
return __PRIVATE_hardAssert(!!e.streamToken), this.lastStreamToken = e.streamToken,
|
|
14561
14561
|
// The first response is always the handshake response
|
|
@@ -15150,7 +15150,7 @@ async function __PRIVATE_remoteStoreHandleCredentialChange(e, t) {
|
|
|
15150
15150
|
Eo: __PRIVATE_onWatchStreamConnected.bind(null, e),
|
|
15151
15151
|
Ro: __PRIVATE_onWatchStreamOpen.bind(null, e),
|
|
15152
15152
|
mo: __PRIVATE_onWatchStreamClose.bind(null, e),
|
|
15153
|
-
|
|
15153
|
+
E_: __PRIVATE_onWatchStreamChange.bind(null, e)
|
|
15154
15154
|
}), e.B_.push((async t => {
|
|
15155
15155
|
t ? (e.K_.s_(), __PRIVATE_shouldStartWatchStream(e) ? __PRIVATE_startWatchStream(e) : e.q_.set("Unknown" /* OnlineState.Unknown */)) : (await e.K_.stop(),
|
|
15156
15156
|
__PRIVATE_cleanUpWatchStreamState(e));
|
|
@@ -15738,13 +15738,13 @@ class __PRIVATE_QueryListener {
|
|
|
15738
15738
|
constructor(e) {
|
|
15739
15739
|
this.serializer = e;
|
|
15740
15740
|
}
|
|
15741
|
-
|
|
15741
|
+
ds(e) {
|
|
15742
15742
|
return fromName(this.serializer, e);
|
|
15743
15743
|
}
|
|
15744
15744
|
/**
|
|
15745
15745
|
* Converts a BundleDocument to a MutableDocument.
|
|
15746
|
-
*/
|
|
15747
|
-
return e.metadata.exists ? __PRIVATE_fromDocument(this.serializer, e.document, !1) : MutableDocument.newNoDocument(this.
|
|
15746
|
+
*/ Es(e) {
|
|
15747
|
+
return e.metadata.exists ? __PRIVATE_fromDocument(this.serializer, e.document, !1) : MutableDocument.newNoDocument(this.ds(e.metadata.name), this.As(e.metadata.readTime));
|
|
15748
15748
|
}
|
|
15749
15749
|
As(e) {
|
|
15750
15750
|
return __PRIVATE_fromVersion(e);
|
|
@@ -15786,7 +15786,7 @@ class __PRIVATE_QueryListener {
|
|
|
15786
15786
|
ha(e) {
|
|
15787
15787
|
const t = new Map, n = new __PRIVATE_BundleConverterImpl(this.serializer);
|
|
15788
15788
|
for (const r of e) if (r.metadata.queries) {
|
|
15789
|
-
const e = n.
|
|
15789
|
+
const e = n.ds(r.metadata.name);
|
|
15790
15790
|
for (const n of r.metadata.queries) {
|
|
15791
15791
|
const r = (t.get(n) || __PRIVATE_documentKeySet()).add(e);
|
|
15792
15792
|
t.set(n, r);
|
|
@@ -15860,7 +15860,7 @@ class __PRIVATE_RemovedLimboDocument {
|
|
|
15860
15860
|
constructor(e,
|
|
15861
15861
|
/** Documents included in the remote target */
|
|
15862
15862
|
t) {
|
|
15863
|
-
this.query = e, this.Ta = t, this.
|
|
15863
|
+
this.query = e, this.Ta = t, this.da = null, this.hasCachedResults = !1,
|
|
15864
15864
|
/**
|
|
15865
15865
|
* A flag whether the view is current with the backend. A view is considered
|
|
15866
15866
|
* current after it has seen the current flag from the backend and did not
|
|
@@ -15869,7 +15869,7 @@ class __PRIVATE_RemovedLimboDocument {
|
|
|
15869
15869
|
*/
|
|
15870
15870
|
this.current = !1,
|
|
15871
15871
|
/** Documents in the view but not in the remote target */
|
|
15872
|
-
this.
|
|
15872
|
+
this.Ea = __PRIVATE_documentKeySet(),
|
|
15873
15873
|
/** Document Keys that have local changes */
|
|
15874
15874
|
this.mutatedKeys = __PRIVATE_documentKeySet(), this.Aa = __PRIVATE_newQueryComparator(e),
|
|
15875
15875
|
this.Ra = new DocumentSet(this.Aa);
|
|
@@ -16014,10 +16014,10 @@ class __PRIVATE_RemovedLimboDocument {
|
|
|
16014
16014
|
* See the License for the specific language governing permissions and
|
|
16015
16015
|
* limitations under the License.
|
|
16016
16016
|
*/ (e.type, t.type) || this.Aa(e.doc, t.doc))), this.pa(n), r = null != r && r;
|
|
16017
|
-
const o = t && !r ? this.ya() : [], _ = 0 === this.
|
|
16017
|
+
const o = t && !r ? this.ya() : [], _ = 0 === this.Ea.size && this.current && !r ? 1 /* SyncState.Synced */ : 0 /* SyncState.Local */ , a = _ !== this.da;
|
|
16018
16018
|
// We are at synced state if there is no limbo docs are waiting to be resolved, view is current
|
|
16019
16019
|
// with the backend, and the query is not pending to reset due to existence filter mismatch.
|
|
16020
|
-
if (this.
|
|
16020
|
+
if (this.da = _, 0 !== s.length || a) {
|
|
16021
16021
|
return {
|
|
16022
16022
|
snapshot: new ViewSnapshot(this.query, e.Ra, i, s, e.mutatedKeys, 0 /* SyncState.Local */ === _, a,
|
|
16023
16023
|
/* excludesMetadataChanges= */ !1, !!n && n.resumeToken.approximateByteSize() > 0),
|
|
@@ -16068,15 +16068,15 @@ class __PRIVATE_RemovedLimboDocument {
|
|
|
16068
16068
|
if (!this.current) return [];
|
|
16069
16069
|
// TODO(klimt): Do this incrementally so that it's not quadratic when
|
|
16070
16070
|
// updating many documents.
|
|
16071
|
-
const e = this.
|
|
16072
|
-
this.
|
|
16073
|
-
this.Sa(e.key) && (this.
|
|
16071
|
+
const e = this.Ea;
|
|
16072
|
+
this.Ea = __PRIVATE_documentKeySet(), this.Ra.forEach((e => {
|
|
16073
|
+
this.Sa(e.key) && (this.Ea = this.Ea.add(e.key));
|
|
16074
16074
|
}));
|
|
16075
16075
|
// Diff the new limbo docs with the old limbo docs.
|
|
16076
16076
|
const t = [];
|
|
16077
16077
|
return e.forEach((e => {
|
|
16078
|
-
this.
|
|
16079
|
-
})), this.
|
|
16078
|
+
this.Ea.has(e) || t.push(new __PRIVATE_RemovedLimboDocument(e));
|
|
16079
|
+
})), this.Ea.forEach((n => {
|
|
16080
16080
|
e.has(n) || t.push(new __PRIVATE_AddedLimboDocument(n));
|
|
16081
16081
|
})), t;
|
|
16082
16082
|
}
|
|
@@ -16101,7 +16101,7 @@ class __PRIVATE_RemovedLimboDocument {
|
|
|
16101
16101
|
*/
|
|
16102
16102
|
// PORTING NOTE: Multi-tab only.
|
|
16103
16103
|
ba(e) {
|
|
16104
|
-
this.Ta = e.Ts, this.
|
|
16104
|
+
this.Ta = e.Ts, this.Ea = __PRIVATE_documentKeySet();
|
|
16105
16105
|
const t = this.ma(e.documents);
|
|
16106
16106
|
return this.applyChanges(t, /* limboResolutionEnabled= */ !0);
|
|
16107
16107
|
}
|
|
@@ -16112,7 +16112,7 @@ class __PRIVATE_RemovedLimboDocument {
|
|
|
16112
16112
|
*/
|
|
16113
16113
|
// PORTING NOTE: Multi-tab only.
|
|
16114
16114
|
Da() {
|
|
16115
|
-
return ViewSnapshot.fromInitialDocuments(this.query, this.Ra, this.mutatedKeys, 0 /* SyncState.Local */ === this.
|
|
16115
|
+
return ViewSnapshot.fromInitialDocuments(this.query, this.Ra, this.mutatedKeys, 0 /* SyncState.Local */ === this.da, this.hasCachedResults);
|
|
16116
16116
|
}
|
|
16117
16117
|
}
|
|
16118
16118
|
|
|
@@ -16413,7 +16413,7 @@ async function __PRIVATE_allocateTargetAndMaybeListen(e, t, n, r) {
|
|
|
16413
16413
|
// Run global snapshot listeners if a consistent snapshot has been emitted.
|
|
16414
16414
|
e.Z_(t) && (r = !0);
|
|
16415
16415
|
})), r && __PRIVATE_raiseSnapshotsInSyncEvent(n);
|
|
16416
|
-
}(r.eventManager, t), e.length && r.Ca.
|
|
16416
|
+
}(r.eventManager, t), e.length && r.Ca.E_(e), r.onlineState = t, r.isPrimaryClient && r.sharedClientState.setOnlineState(t);
|
|
16417
16417
|
}
|
|
16418
16418
|
}
|
|
16419
16419
|
|
|
@@ -16617,7 +16617,7 @@ async function __PRIVATE_syncEngineEmitNewSnapsAndNotifyLocalStore(e, t, n) {
|
|
|
16617
16617
|
s.push(t);
|
|
16618
16618
|
}
|
|
16619
16619
|
})));
|
|
16620
|
-
})), await Promise.all(o), r.Ca.
|
|
16620
|
+
})), await Promise.all(o), r.Ca.E_(i), await async function __PRIVATE_localStoreNotifyLocalViewChanges(e, t) {
|
|
16621
16621
|
const n = __PRIVATE_debugCast(e);
|
|
16622
16622
|
try {
|
|
16623
16623
|
await n.persistence.runTransaction("notifyLocalViewChanges", "readwrite", (e => PersistencePromise.forEach(t, (t => PersistencePromise.forEach(t.$i, (r => n.persistence.referenceDelegate.addReference(e, t.targetId, r))).next((() => PersistencePromise.forEach(t.Ui, (r => n.persistence.referenceDelegate.removeReference(e, t.targetId, r)))))))));
|
|
@@ -16795,7 +16795,7 @@ async function __PRIVATE_synchronizeQueryViewsAndRaiseSnapshots(e, t, n) {
|
|
|
16795
16795
|
}
|
|
16796
16796
|
i.push(t);
|
|
16797
16797
|
}
|
|
16798
|
-
return r.Ca.
|
|
16798
|
+
return r.Ca.E_(s), i;
|
|
16799
16799
|
}
|
|
16800
16800
|
|
|
16801
16801
|
/**
|
|
@@ -16878,7 +16878,7 @@ function __PRIVATE_ensureWatchCallbacks(e) {
|
|
|
16878
16878
|
return t.remoteStore.remoteSyncer.applyRemoteEvent = __PRIVATE_syncEngineApplyRemoteEvent.bind(null, t),
|
|
16879
16879
|
t.remoteStore.remoteSyncer.getRemoteKeysForTarget = __PRIVATE_syncEngineGetRemoteKeysForTarget.bind(null, t),
|
|
16880
16880
|
t.remoteStore.remoteSyncer.rejectListen = __PRIVATE_syncEngineRejectListen.bind(null, t),
|
|
16881
|
-
t.Ca.
|
|
16881
|
+
t.Ca.E_ = __PRIVATE_eventManagerOnWatchChange.bind(null, t.eventManager), t.Ca.$a = __PRIVATE_eventManagerOnWatchError.bind(null, t.eventManager),
|
|
16882
16882
|
t;
|
|
16883
16883
|
}
|
|
16884
16884
|
|
|
@@ -18603,13 +18603,13 @@ function doc(e, t, ...n) {
|
|
|
18603
18603
|
// Visibility handler that triggers an immediate retry of all retryable
|
|
18604
18604
|
// operations. Meant to speed up recovery when we regain file system access
|
|
18605
18605
|
// after page comes into foreground.
|
|
18606
|
-
this.
|
|
18606
|
+
this.du = () => {
|
|
18607
18607
|
const e = getDocument();
|
|
18608
18608
|
e && __PRIVATE_logDebug("AsyncQueue", "Visibility state changed to " + e.visibilityState),
|
|
18609
18609
|
this.t_.jo();
|
|
18610
18610
|
};
|
|
18611
18611
|
const e = getDocument();
|
|
18612
|
-
e && "function" == typeof e.addEventListener && e.addEventListener("visibilitychange", this.
|
|
18612
|
+
e && "function" == typeof e.addEventListener && e.addEventListener("visibilitychange", this.du);
|
|
18613
18613
|
}
|
|
18614
18614
|
get isShuttingDown() {
|
|
18615
18615
|
return this.cu;
|
|
@@ -18622,7 +18622,7 @@ function doc(e, t, ...n) {
|
|
|
18622
18622
|
this.enqueue(e);
|
|
18623
18623
|
}
|
|
18624
18624
|
enqueueAndForgetEvenWhileRestricted(e) {
|
|
18625
|
-
this.
|
|
18625
|
+
this.Eu(),
|
|
18626
18626
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
18627
18627
|
this.Au(e);
|
|
18628
18628
|
}
|
|
@@ -18630,11 +18630,11 @@ function doc(e, t, ...n) {
|
|
|
18630
18630
|
if (!this.cu) {
|
|
18631
18631
|
this.cu = !0, this.Iu = e || !1;
|
|
18632
18632
|
const t = getDocument();
|
|
18633
|
-
t && "function" == typeof t.removeEventListener && t.removeEventListener("visibilitychange", this.
|
|
18633
|
+
t && "function" == typeof t.removeEventListener && t.removeEventListener("visibilitychange", this.du);
|
|
18634
18634
|
}
|
|
18635
18635
|
}
|
|
18636
18636
|
enqueue(e) {
|
|
18637
|
-
if (this.
|
|
18637
|
+
if (this.Eu(), this.cu)
|
|
18638
18638
|
// Return a Promise which never resolves.
|
|
18639
18639
|
return new Promise((() => {}));
|
|
18640
18640
|
// Create a deferred Promise that we can return to the callee. This
|
|
@@ -18711,13 +18711,13 @@ function doc(e, t, ...n) {
|
|
|
18711
18711
|
return this.au = t, t;
|
|
18712
18712
|
}
|
|
18713
18713
|
enqueueAfterDelay(e, t, n) {
|
|
18714
|
-
this.
|
|
18714
|
+
this.Eu(),
|
|
18715
18715
|
// Fast-forward delays for timerIds that have been overridden.
|
|
18716
18716
|
this.Tu.indexOf(e) > -1 && (t = 0);
|
|
18717
18717
|
const r = DelayedOperation.createAndSchedule(this, e, t, n, (e => this.Vu(e)));
|
|
18718
18718
|
return this.lu.push(r), r;
|
|
18719
18719
|
}
|
|
18720
|
-
|
|
18720
|
+
Eu() {
|
|
18721
18721
|
this.hu && fail();
|
|
18722
18722
|
}
|
|
18723
18723
|
verifyOperationInProgress() {}
|
|
@@ -22233,9 +22233,9 @@ let Me = null;
|
|
|
22233
22233
|
return r = Object.assign({
|
|
22234
22234
|
useFetchStreams: t
|
|
22235
22235
|
}, r), s._setSettings(r), s;
|
|
22236
|
-
}), "PUBLIC").setMultipleInstances(!0)), app.registerVersion(S, "4.7.1-canary.
|
|
22236
|
+
}), "PUBLIC").setMultipleInstances(!0)), app.registerVersion(S, "4.7.1-canary.16d62d4fa", e),
|
|
22237
22237
|
// BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
|
|
22238
|
-
app.registerVersion(S, "4.7.1-canary.
|
|
22238
|
+
app.registerVersion(S, "4.7.1-canary.16d62d4fa", "cjs2017");
|
|
22239
22239
|
}();
|
|
22240
22240
|
|
|
22241
22241
|
exports.AbstractUserDataWriter = AbstractUserDataWriter;
|