@firebase/firestore 4.7.4-canary.0f5a9aad0 → 4.7.4-canary.4db3d3e7b
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 +159 -159
- package/dist/index.esm2017.js +159 -159
- package/dist/index.node.cjs.js +2 -2
- package/dist/index.node.mjs +2 -2
- package/dist/index.rn.js +89 -89
- package/dist/lite/index.browser.esm2017.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/package.json +9 -9
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
|
|
74
|
+
let b = "11.0.1-canary.4db3d3e7b";
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* @license
|
|
@@ -89,11 +89,11 @@ let S = "11.0.0-canary.0f5a9aad0";
|
|
|
89
89
|
* See the License for the specific language governing permissions and
|
|
90
90
|
* limitations under the License.
|
|
91
91
|
*/
|
|
92
|
-
const
|
|
92
|
+
const S = new logger.Logger("@firebase/firestore");
|
|
93
93
|
|
|
94
94
|
// Helper methods are needed because variables can't be exported as read/write
|
|
95
95
|
function __PRIVATE_getLogLevel() {
|
|
96
|
-
return
|
|
96
|
+
return S.logLevel;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
/**
|
|
@@ -109,29 +109,29 @@ function __PRIVATE_getLogLevel() {
|
|
|
109
109
|
* <li><code>`silent` to turn off logging.</li>
|
|
110
110
|
* </ul>
|
|
111
111
|
*/ function setLogLevel(e) {
|
|
112
|
-
|
|
112
|
+
S.setLogLevel(e);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
function __PRIVATE_logDebug(e, ...t) {
|
|
116
|
-
if (
|
|
116
|
+
if (S.logLevel <= logger.LogLevel.DEBUG) {
|
|
117
117
|
const n = t.map(__PRIVATE_argToString);
|
|
118
|
-
|
|
118
|
+
S.debug(`Firestore (${b}): ${e}`, ...n);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
function __PRIVATE_logError(e, ...t) {
|
|
123
|
-
if (
|
|
123
|
+
if (S.logLevel <= logger.LogLevel.ERROR) {
|
|
124
124
|
const n = t.map(__PRIVATE_argToString);
|
|
125
|
-
|
|
125
|
+
S.error(`Firestore (${b}): ${e}`, ...n);
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
/**
|
|
130
130
|
* @internal
|
|
131
131
|
*/ function __PRIVATE_logWarn(e, ...t) {
|
|
132
|
-
if (
|
|
132
|
+
if (S.logLevel <= logger.LogLevel.WARN) {
|
|
133
133
|
const n = t.map(__PRIVATE_argToString);
|
|
134
|
-
|
|
134
|
+
S.warn(`Firestore (${b}): ${e}`, ...n);
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
|
|
@@ -192,7 +192,7 @@ function __PRIVATE_logError(e, ...t) {
|
|
|
192
192
|
*/ function fail(e = "Unexpected state") {
|
|
193
193
|
// Log the failure in addition to throw an exception, just in case the
|
|
194
194
|
// exception is swallowed.
|
|
195
|
-
const t = `FIRESTORE (${
|
|
195
|
+
const t = `FIRESTORE (${b}) INTERNAL ASSERTION FAILED: ` + e;
|
|
196
196
|
// NOTE: We don't use FirestoreError here because these are internal failures
|
|
197
197
|
// that cannot be handled by the user. (Also it would create a circular
|
|
198
198
|
// dependency between the error and assert modules which doesn't work.)
|
|
@@ -5897,7 +5897,7 @@ class BloomFilter {
|
|
|
5897
5897
|
}
|
|
5898
5898
|
// Calculate the ith hash value based on the hashed 64bit integers,
|
|
5899
5899
|
// and calculate its corresponding bit index in the bitmap to be checked.
|
|
5900
|
-
|
|
5900
|
+
de(e, t, n) {
|
|
5901
5901
|
// Calculate hashed value h(i) = h1 + (i * h2).
|
|
5902
5902
|
let r = e.add(t.multiply(bloomBlob.Integer.fromNumber(n)));
|
|
5903
5903
|
// Wrap if hash value overflow 64bit.
|
|
@@ -5905,7 +5905,7 @@ class BloomFilter {
|
|
|
5905
5905
|
r.modulo(this.Te).toNumber();
|
|
5906
5906
|
}
|
|
5907
5907
|
// Return whether the bit on the given index in the bitmap is set to 1.
|
|
5908
|
-
|
|
5908
|
+
Ee(e) {
|
|
5909
5909
|
return 0 != (this.bitmap[Math.floor(e / 8)] & 1 << e % 8);
|
|
5910
5910
|
}
|
|
5911
5911
|
mightContain(e) {
|
|
@@ -5913,8 +5913,8 @@ class BloomFilter {
|
|
|
5913
5913
|
if (0 === this.Ie) return !1;
|
|
5914
5914
|
const t = __PRIVATE_getMd5HashValue(e), [n, r] = __PRIVATE_get64BitUints(t);
|
|
5915
5915
|
for (let e = 0; e < this.hashCount; e++) {
|
|
5916
|
-
const t = this.
|
|
5917
|
-
if (!this.
|
|
5916
|
+
const t = this.de(n, r, e);
|
|
5917
|
+
if (!this.Ee(t)) return !1;
|
|
5918
5918
|
}
|
|
5919
5919
|
return !0;
|
|
5920
5920
|
}
|
|
@@ -5926,7 +5926,7 @@ class BloomFilter {
|
|
|
5926
5926
|
if (0 === this.Ie) return;
|
|
5927
5927
|
const t = __PRIVATE_getMd5HashValue(e), [n, r] = __PRIVATE_get64BitUints(t);
|
|
5928
5928
|
for (let e = 0; e < this.hashCount; e++) {
|
|
5929
|
-
const t = this.
|
|
5929
|
+
const t = this.de(n, r, e);
|
|
5930
5930
|
this.Ae(t);
|
|
5931
5931
|
}
|
|
5932
5932
|
}
|
|
@@ -6151,10 +6151,10 @@ class __PRIVATE_WatchTargetChange {
|
|
|
6151
6151
|
/** The last resume token sent to us for this target. */ get resumeToken() {
|
|
6152
6152
|
return this.pe;
|
|
6153
6153
|
}
|
|
6154
|
-
/** Whether this target has pending target adds or target removes. */ get
|
|
6154
|
+
/** Whether this target has pending target adds or target removes. */ get be() {
|
|
6155
6155
|
return 0 !== this.fe;
|
|
6156
6156
|
}
|
|
6157
|
-
/** Whether we have modified any state that should trigger a snapshot. */ get
|
|
6157
|
+
/** Whether we have modified any state that should trigger a snapshot. */ get Se() {
|
|
6158
6158
|
return this.we;
|
|
6159
6159
|
}
|
|
6160
6160
|
/**
|
|
@@ -6247,7 +6247,7 @@ class __PRIVATE_WatchChangeAggregator {
|
|
|
6247
6247
|
case 1 /* WatchTargetChangeState.Added */ :
|
|
6248
6248
|
// We need to decrement the number of pending acks needed from watch
|
|
6249
6249
|
// for this targetId.
|
|
6250
|
-
n.Oe(), n.
|
|
6250
|
+
n.Oe(), n.be ||
|
|
6251
6251
|
// We have a freshly added target, so we need to reset any state
|
|
6252
6252
|
// that we had previously. This can happen e.g. when remove and add
|
|
6253
6253
|
// back a target for existence filter mismatches.
|
|
@@ -6259,7 +6259,7 @@ class __PRIVATE_WatchChangeAggregator {
|
|
|
6259
6259
|
// remove any target changes.
|
|
6260
6260
|
// We need to decrement the number of pending acks needed from watch
|
|
6261
6261
|
// for this targetId.
|
|
6262
|
-
n.Oe(), n.
|
|
6262
|
+
n.Oe(), n.be || this.removeTarget(t);
|
|
6263
6263
|
break;
|
|
6264
6264
|
|
|
6265
6265
|
case 3 /* WatchTargetChangeState.Current */ :
|
|
@@ -6420,7 +6420,7 @@ class __PRIVATE_WatchChangeAggregator {
|
|
|
6420
6420
|
const t = new DocumentKey(i.target.path);
|
|
6421
6421
|
null !== this.ke.get(t) || this.it(r, t) || this.Ue(r, t, MutableDocument.newNoDocument(t, e));
|
|
6422
6422
|
}
|
|
6423
|
-
n.
|
|
6423
|
+
n.Se && (t.set(r, n.ve()), n.Ce());
|
|
6424
6424
|
}
|
|
6425
6425
|
}));
|
|
6426
6426
|
let n = __PRIVATE_documentKeySet();
|
|
@@ -6507,7 +6507,7 @@ class __PRIVATE_WatchChangeAggregator {
|
|
|
6507
6507
|
* is still interested in that has no outstanding target change requests).
|
|
6508
6508
|
*/ Je(e) {
|
|
6509
6509
|
const t = this.Be.get(e);
|
|
6510
|
-
return t && t.
|
|
6510
|
+
return t && t.be ? null : this.Le.ot(e);
|
|
6511
6511
|
}
|
|
6512
6512
|
/**
|
|
6513
6513
|
* Resets the state of a Watch target to its initial state (e.g. sets
|
|
@@ -6541,7 +6541,7 @@ const Te = (() => {
|
|
|
6541
6541
|
desc: "DESCENDING"
|
|
6542
6542
|
};
|
|
6543
6543
|
return e;
|
|
6544
|
-
})(),
|
|
6544
|
+
})(), de = (() => {
|
|
6545
6545
|
const e = {
|
|
6546
6546
|
"<": "LESS_THAN",
|
|
6547
6547
|
"<=": "LESS_THAN_OR_EQUAL",
|
|
@@ -6555,7 +6555,7 @@ const Te = (() => {
|
|
|
6555
6555
|
"array-contains-any": "ARRAY_CONTAINS_ANY"
|
|
6556
6556
|
};
|
|
6557
6557
|
return e;
|
|
6558
|
-
})(),
|
|
6558
|
+
})(), Ee = (() => {
|
|
6559
6559
|
const e = {
|
|
6560
6560
|
and: "AND",
|
|
6561
6561
|
or: "OR"
|
|
@@ -7131,11 +7131,11 @@ function __PRIVATE_toDirection(e) {
|
|
|
7131
7131
|
}
|
|
7132
7132
|
|
|
7133
7133
|
function __PRIVATE_toOperatorName(e) {
|
|
7134
|
-
return
|
|
7134
|
+
return de[e];
|
|
7135
7135
|
}
|
|
7136
7136
|
|
|
7137
7137
|
function __PRIVATE_toCompositeOperatorName(e) {
|
|
7138
|
-
return
|
|
7138
|
+
return Ee[e];
|
|
7139
7139
|
}
|
|
7140
7140
|
|
|
7141
7141
|
function __PRIVATE_toFieldPathReference(e) {
|
|
@@ -7716,59 +7716,59 @@ class __PRIVATE_FirestoreIndexValueWriter {
|
|
|
7716
7716
|
this.Tt(e, t),
|
|
7717
7717
|
// Write separator to split index values
|
|
7718
7718
|
// (see go/firestore-storage-format#encodings).
|
|
7719
|
-
t.
|
|
7719
|
+
t.dt();
|
|
7720
7720
|
}
|
|
7721
7721
|
Tt(e, t) {
|
|
7722
|
-
if ("nullValue" in e) this.
|
|
7723
|
-
t.At(e.booleanValue ? 1 : 0); else if ("integerValue" in e) this.
|
|
7722
|
+
if ("nullValue" in e) this.Et(t, 5); else if ("booleanValue" in e) this.Et(t, 10),
|
|
7723
|
+
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) {
|
|
7724
7724
|
const n = __PRIVATE_normalizeNumber(e.doubleValue);
|
|
7725
|
-
isNaN(n) ? this.
|
|
7725
|
+
isNaN(n) ? this.Et(t, 13) : (this.Et(t, 15), __PRIVATE_isNegativeZero(n) ?
|
|
7726
7726
|
// -0.0, 0 and 0.0 are all considered the same
|
|
7727
7727
|
t.At(0) : t.At(n));
|
|
7728
7728
|
} else if ("timestampValue" in e) {
|
|
7729
7729
|
let n = e.timestampValue;
|
|
7730
|
-
this.
|
|
7730
|
+
this.Et(t, 20), "string" == typeof n && (n = __PRIVATE_normalizeTimestamp(n)), t.Rt(`${n.seconds || ""}`),
|
|
7731
7731
|
t.At(n.nanos || 0);
|
|
7732
|
-
} else if ("stringValue" in e) this.Vt(e.stringValue, t), this.ft(t); else if ("bytesValue" in e) this.
|
|
7732
|
+
} else if ("stringValue" in e) this.Vt(e.stringValue, t), this.ft(t); else if ("bytesValue" in e) this.Et(t, 30),
|
|
7733
7733
|
t.gt(__PRIVATE_normalizeByteString(e.bytesValue)), this.ft(t); else if ("referenceValue" in e) this.yt(e.referenceValue, t); else if ("geoPointValue" in e) {
|
|
7734
7734
|
const n = e.geoPointValue;
|
|
7735
|
-
this.
|
|
7736
|
-
} else "mapValue" in e ? __PRIVATE_isMaxValue(e) ? this.
|
|
7737
|
-
this.ft(t)) : "arrayValue" in e ? (this.
|
|
7735
|
+
this.Et(t, 45), t.At(n.latitude || 0), t.At(n.longitude || 0);
|
|
7736
|
+
} else "mapValue" in e ? __PRIVATE_isMaxValue(e) ? this.Et(t, Number.MAX_SAFE_INTEGER) : __PRIVATE_isVectorValue(e) ? this.wt(e.mapValue, t) : (this.bt(e.mapValue, t),
|
|
7737
|
+
this.ft(t)) : "arrayValue" in e ? (this.St(e.arrayValue, t), this.ft(t)) : fail();
|
|
7738
7738
|
}
|
|
7739
7739
|
Vt(e, t) {
|
|
7740
|
-
this.
|
|
7740
|
+
this.Et(t, 25), this.Dt(e, t);
|
|
7741
7741
|
}
|
|
7742
7742
|
Dt(e, t) {
|
|
7743
7743
|
t.Rt(e);
|
|
7744
7744
|
}
|
|
7745
|
-
|
|
7745
|
+
bt(e, t) {
|
|
7746
7746
|
const n = e.fields || {};
|
|
7747
|
-
this.
|
|
7747
|
+
this.Et(t, 55);
|
|
7748
7748
|
for (const e of Object.keys(n)) this.Vt(e, t), this.Tt(n[e], t);
|
|
7749
7749
|
}
|
|
7750
7750
|
wt(e, t) {
|
|
7751
7751
|
var n, r;
|
|
7752
7752
|
const i = e.fields || {};
|
|
7753
|
-
this.
|
|
7753
|
+
this.Et(t, 53);
|
|
7754
7754
|
// Vectors sort first by length
|
|
7755
7755
|
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;
|
|
7756
|
-
this.
|
|
7756
|
+
this.Et(t, 15), t.At(__PRIVATE_normalizeNumber(o)),
|
|
7757
7757
|
// Vectors then sort by position value
|
|
7758
7758
|
this.Vt(s, t), this.Tt(i[s], t);
|
|
7759
7759
|
}
|
|
7760
|
-
|
|
7760
|
+
St(e, t) {
|
|
7761
7761
|
const n = e.values || [];
|
|
7762
|
-
this.
|
|
7762
|
+
this.Et(t, 50);
|
|
7763
7763
|
for (const e of n) this.Tt(e, t);
|
|
7764
7764
|
}
|
|
7765
7765
|
yt(e, t) {
|
|
7766
|
-
this.
|
|
7766
|
+
this.Et(t, 37);
|
|
7767
7767
|
DocumentKey.fromName(e).path.forEach((e => {
|
|
7768
|
-
this.
|
|
7768
|
+
this.Et(t, 60), this.Dt(e, t);
|
|
7769
7769
|
}));
|
|
7770
7770
|
}
|
|
7771
|
-
|
|
7771
|
+
Et(e, t) {
|
|
7772
7772
|
e.At(t);
|
|
7773
7773
|
}
|
|
7774
7774
|
ft(e) {
|
|
@@ -7968,7 +7968,7 @@ class __PRIVATE_AscendingIndexByteEncoder {
|
|
|
7968
7968
|
At(e) {
|
|
7969
7969
|
this.jt.kt(e);
|
|
7970
7970
|
}
|
|
7971
|
-
|
|
7971
|
+
dt() {
|
|
7972
7972
|
this.jt.$t();
|
|
7973
7973
|
}
|
|
7974
7974
|
}
|
|
@@ -7986,7 +7986,7 @@ class __PRIVATE_DescendingIndexByteEncoder {
|
|
|
7986
7986
|
At(e) {
|
|
7987
7987
|
this.jt.Kt(e);
|
|
7988
7988
|
}
|
|
7989
|
-
|
|
7989
|
+
dt() {
|
|
7990
7990
|
this.jt.Wt();
|
|
7991
7991
|
}
|
|
7992
7992
|
}
|
|
@@ -8684,7 +8684,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8684
8684
|
n.push(t.value), r && (r = t.inclusive);
|
|
8685
8685
|
}
|
|
8686
8686
|
return new Bound(n, r);
|
|
8687
|
-
}(s, i), c = this.In(i, s, a), l = this.In(i, s, u), h = this.Tn(i, s, _), P = this.
|
|
8687
|
+
}(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);
|
|
8688
8688
|
return PersistencePromise.forEach(P, (i => n.G(i, t.limit).next((t => {
|
|
8689
8689
|
t.forEach((t => {
|
|
8690
8690
|
const n = DocumentKey.fromSegments(t.documentKey);
|
|
@@ -8707,14 +8707,14 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8707
8707
|
/**
|
|
8708
8708
|
* Constructs a key range query on `DbIndexEntryStore` that unions all
|
|
8709
8709
|
* bounds.
|
|
8710
|
-
*/
|
|
8710
|
+
*/ dn(e, t, n, r, i, s, o) {
|
|
8711
8711
|
// The number of total index scans we union together. This is similar to a
|
|
8712
8712
|
// distributed normal form, but adapted for array values. We create a single
|
|
8713
8713
|
// index range per value in an ARRAY_CONTAINS or ARRAY_CONTAINS_ANY filter
|
|
8714
8714
|
// combined with the values from the query bounds.
|
|
8715
8715
|
const _ = (null != t ? t.length : 1) * Math.max(n.length, i.length), a = _ / (null != t ? t.length : 1), u = [];
|
|
8716
8716
|
for (let c = 0; c < _; ++c) {
|
|
8717
|
-
const _ = t ? this.
|
|
8717
|
+
const _ = t ? this.En(t[c / a]) : Ae, l = this.An(e, _, n[c % a], r), h = this.Rn(e, _, i[c % a], s), P = o.map((t => this.An(e, _, t,
|
|
8718
8718
|
/* inclusive= */ !0)));
|
|
8719
8719
|
u.push(...this.createRange(l, h, P));
|
|
8720
8720
|
}
|
|
@@ -8782,7 +8782,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8782
8782
|
}
|
|
8783
8783
|
return n.zt();
|
|
8784
8784
|
}
|
|
8785
|
-
/** Encodes a single value to the ascending index format. */
|
|
8785
|
+
/** Encodes a single value to the ascending index format. */ En(e) {
|
|
8786
8786
|
const t = new __PRIVATE_IndexByteEncoder;
|
|
8787
8787
|
return __PRIVATE_FirestoreIndexValueWriter.vt.It(e, t.Yt(0 /* IndexKind.ASCENDING */)),
|
|
8788
8788
|
t.zt();
|
|
@@ -8875,8 +8875,8 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8875
8875
|
const i = n.get(t.collectionGroup);
|
|
8876
8876
|
return (i ? PersistencePromise.resolve(i) : this.getFieldIndexes(e, t.collectionGroup)).next((i => (n.set(t.collectionGroup, i),
|
|
8877
8877
|
PersistencePromise.forEach(i, (n => this.wn(e, t, n).next((t => {
|
|
8878
|
-
const i = this.
|
|
8879
|
-
return t.isEqual(i) ? PersistencePromise.resolve() : this.
|
|
8878
|
+
const i = this.bn(r, n);
|
|
8879
|
+
return t.isEqual(i) ? PersistencePromise.resolve() : this.Sn(e, r, n, t, i);
|
|
8880
8880
|
})))))));
|
|
8881
8881
|
}));
|
|
8882
8882
|
}
|
|
@@ -8903,14 +8903,14 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8903
8903
|
i = i.add(new __PRIVATE_IndexEntry(n.indexId, t, r.arrayValue, r.directionalValue));
|
|
8904
8904
|
})).next((() => i));
|
|
8905
8905
|
}
|
|
8906
|
-
/** Creates the index entries for the given document. */
|
|
8906
|
+
/** Creates the index entries for the given document. */ bn(e, t) {
|
|
8907
8907
|
let n = new SortedSet(__PRIVATE_indexEntryComparator);
|
|
8908
8908
|
const r = this.Vn(t, e);
|
|
8909
8909
|
if (null == r) return n;
|
|
8910
8910
|
const i = __PRIVATE_fieldIndexGetArraySegment(t);
|
|
8911
8911
|
if (null != i) {
|
|
8912
8912
|
const s = e.data.field(i.fieldPath);
|
|
8913
|
-
if (isArray(s)) for (const i of s.arrayValue.values || []) n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key, this.
|
|
8913
|
+
if (isArray(s)) for (const i of s.arrayValue.values || []) n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key, this.En(i), r));
|
|
8914
8914
|
} else n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key, Ae, r));
|
|
8915
8915
|
return n;
|
|
8916
8916
|
}
|
|
@@ -8918,7 +8918,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8918
8918
|
* Updates the index entries for the provided document by deleting entries
|
|
8919
8919
|
* that are no longer referenced in `newEntries` and adding all newly added
|
|
8920
8920
|
* entries.
|
|
8921
|
-
*/
|
|
8921
|
+
*/ Sn(e, t, n, r, i) {
|
|
8922
8922
|
__PRIVATE_logDebug("IndexedDbIndexManager", "Updating index entries for document '%s'", t.key);
|
|
8923
8923
|
const s = [];
|
|
8924
8924
|
return function __PRIVATE_diffSortedSets(e, t, n, r, i) {
|
|
@@ -10856,16 +10856,16 @@ class OverlayedDocument {
|
|
|
10856
10856
|
*/ class __PRIVATE_ReferenceSet {
|
|
10857
10857
|
constructor() {
|
|
10858
10858
|
// A set of outstanding references to a document sorted by key.
|
|
10859
|
-
this.Tr = new SortedSet(__PRIVATE_DocReference.
|
|
10859
|
+
this.Tr = new SortedSet(__PRIVATE_DocReference.dr),
|
|
10860
10860
|
// A set of outstanding references to a document sorted by target id.
|
|
10861
|
-
this.
|
|
10861
|
+
this.Er = new SortedSet(__PRIVATE_DocReference.Ar);
|
|
10862
10862
|
}
|
|
10863
10863
|
/** Returns true if the reference set contains no references. */ isEmpty() {
|
|
10864
10864
|
return this.Tr.isEmpty();
|
|
10865
10865
|
}
|
|
10866
10866
|
/** Adds a reference to the given document key for the given ID. */ addReference(e, t) {
|
|
10867
10867
|
const n = new __PRIVATE_DocReference(e, t);
|
|
10868
|
-
this.Tr = this.Tr.add(n), this.
|
|
10868
|
+
this.Tr = this.Tr.add(n), this.Er = this.Er.add(n);
|
|
10869
10869
|
}
|
|
10870
10870
|
/** Add references to the given document keys for the given ID. */ Rr(e, t) {
|
|
10871
10871
|
e.forEach((e => this.addReference(e, t)));
|
|
@@ -10884,7 +10884,7 @@ class OverlayedDocument {
|
|
|
10884
10884
|
* removed.
|
|
10885
10885
|
*/ gr(e) {
|
|
10886
10886
|
const t = new DocumentKey(new ResourcePath([])), n = new __PRIVATE_DocReference(t, e), r = new __PRIVATE_DocReference(t, e + 1), i = [];
|
|
10887
|
-
return this.
|
|
10887
|
+
return this.Er.forEachInRange([ n, r ], (e => {
|
|
10888
10888
|
this.Vr(e), i.push(e.key);
|
|
10889
10889
|
})), i;
|
|
10890
10890
|
}
|
|
@@ -10892,12 +10892,12 @@ class OverlayedDocument {
|
|
|
10892
10892
|
this.Tr.forEach((e => this.Vr(e)));
|
|
10893
10893
|
}
|
|
10894
10894
|
Vr(e) {
|
|
10895
|
-
this.Tr = this.Tr.delete(e), this.
|
|
10895
|
+
this.Tr = this.Tr.delete(e), this.Er = this.Er.delete(e);
|
|
10896
10896
|
}
|
|
10897
10897
|
yr(e) {
|
|
10898
10898
|
const t = new DocumentKey(new ResourcePath([])), n = new __PRIVATE_DocReference(t, e), r = new __PRIVATE_DocReference(t, e + 1);
|
|
10899
10899
|
let i = __PRIVATE_documentKeySet();
|
|
10900
|
-
return this.
|
|
10900
|
+
return this.Er.forEachInRange([ n, r ], (e => {
|
|
10901
10901
|
i = i.add(e.key);
|
|
10902
10902
|
})), i;
|
|
10903
10903
|
}
|
|
@@ -10911,7 +10911,7 @@ class __PRIVATE_DocReference {
|
|
|
10911
10911
|
constructor(e, t) {
|
|
10912
10912
|
this.key = e, this.wr = t;
|
|
10913
10913
|
}
|
|
10914
|
-
/** Compare by key then by ID */ static
|
|
10914
|
+
/** Compare by key then by ID */ static dr(e, t) {
|
|
10915
10915
|
return DocumentKey.comparator(e.key, t.key) || __PRIVATE_primitiveComparator(e.wr, t.wr);
|
|
10916
10916
|
}
|
|
10917
10917
|
/** Compare by ID then by key */ static Ar(e, t) {
|
|
@@ -10943,20 +10943,20 @@ class __PRIVATE_DocReference {
|
|
|
10943
10943
|
*/
|
|
10944
10944
|
this.mutationQueue = [],
|
|
10945
10945
|
/** Next value to use when assigning sequential IDs to each mutation batch. */
|
|
10946
|
-
this.
|
|
10946
|
+
this.br = 1,
|
|
10947
10947
|
/** An ordered mapping between documents and the mutations batch IDs. */
|
|
10948
|
-
this.
|
|
10948
|
+
this.Sr = new SortedSet(__PRIVATE_DocReference.dr);
|
|
10949
10949
|
}
|
|
10950
10950
|
checkEmpty(e) {
|
|
10951
10951
|
return PersistencePromise.resolve(0 === this.mutationQueue.length);
|
|
10952
10952
|
}
|
|
10953
10953
|
addMutationBatch(e, t, n, r) {
|
|
10954
|
-
const i = this.
|
|
10955
|
-
this.
|
|
10954
|
+
const i = this.br;
|
|
10955
|
+
this.br++, this.mutationQueue.length > 0 && this.mutationQueue[this.mutationQueue.length - 1];
|
|
10956
10956
|
const s = new MutationBatch(i, t, n, r);
|
|
10957
10957
|
this.mutationQueue.push(s);
|
|
10958
10958
|
// Track references by document key and index collection parents.
|
|
10959
|
-
for (const t of r) this.
|
|
10959
|
+
for (const t of r) this.Sr = this.Sr.add(new __PRIVATE_DocReference(t.key, i)),
|
|
10960
10960
|
this.indexManager.addToCollectionParentIndex(e, t.key.path.popLast());
|
|
10961
10961
|
return PersistencePromise.resolve(s);
|
|
10962
10962
|
}
|
|
@@ -10970,14 +10970,14 @@ class __PRIVATE_DocReference {
|
|
|
10970
10970
|
return PersistencePromise.resolve(this.mutationQueue.length > i ? this.mutationQueue[i] : null);
|
|
10971
10971
|
}
|
|
10972
10972
|
getHighestUnacknowledgedBatchId() {
|
|
10973
|
-
return PersistencePromise.resolve(0 === this.mutationQueue.length ? -1 : this.
|
|
10973
|
+
return PersistencePromise.resolve(0 === this.mutationQueue.length ? -1 : this.br - 1);
|
|
10974
10974
|
}
|
|
10975
10975
|
getAllMutationBatches(e) {
|
|
10976
10976
|
return PersistencePromise.resolve(this.mutationQueue.slice());
|
|
10977
10977
|
}
|
|
10978
10978
|
getAllMutationBatchesAffectingDocumentKey(e, t) {
|
|
10979
10979
|
const n = new __PRIVATE_DocReference(t, 0), r = new __PRIVATE_DocReference(t, Number.POSITIVE_INFINITY), i = [];
|
|
10980
|
-
return this.
|
|
10980
|
+
return this.Sr.forEachInRange([ n, r ], (e => {
|
|
10981
10981
|
const t = this.Dr(e.wr);
|
|
10982
10982
|
i.push(t);
|
|
10983
10983
|
})), PersistencePromise.resolve(i);
|
|
@@ -10986,7 +10986,7 @@ class __PRIVATE_DocReference {
|
|
|
10986
10986
|
let n = new SortedSet(__PRIVATE_primitiveComparator);
|
|
10987
10987
|
return t.forEach((e => {
|
|
10988
10988
|
const t = new __PRIVATE_DocReference(e, 0), r = new __PRIVATE_DocReference(e, Number.POSITIVE_INFINITY);
|
|
10989
|
-
this.
|
|
10989
|
+
this.Sr.forEachInRange([ t, r ], (e => {
|
|
10990
10990
|
n = n.add(e.wr);
|
|
10991
10991
|
}));
|
|
10992
10992
|
})), PersistencePromise.resolve(this.Cr(n));
|
|
@@ -11005,7 +11005,7 @@ class __PRIVATE_DocReference {
|
|
|
11005
11005
|
// Find unique batchIDs referenced by all documents potentially matching the
|
|
11006
11006
|
// query.
|
|
11007
11007
|
let o = new SortedSet(__PRIVATE_primitiveComparator);
|
|
11008
|
-
return this.
|
|
11008
|
+
return this.Sr.forEachWhile((e => {
|
|
11009
11009
|
const t = e.key.path;
|
|
11010
11010
|
return !!n.isPrefixOf(t) && (
|
|
11011
11011
|
// Rows with document keys more than one segment longer than the query
|
|
@@ -11027,19 +11027,19 @@ class __PRIVATE_DocReference {
|
|
|
11027
11027
|
}
|
|
11028
11028
|
removeMutationBatch(e, t) {
|
|
11029
11029
|
__PRIVATE_hardAssert(0 === this.Fr(t.batchId, "removed")), this.mutationQueue.shift();
|
|
11030
|
-
let n = this.
|
|
11030
|
+
let n = this.Sr;
|
|
11031
11031
|
return PersistencePromise.forEach(t.mutations, (r => {
|
|
11032
11032
|
const i = new __PRIVATE_DocReference(r.key, t.batchId);
|
|
11033
11033
|
return n = n.delete(i), this.referenceDelegate.markPotentiallyOrphaned(e, r.key);
|
|
11034
11034
|
})).next((() => {
|
|
11035
|
-
this.
|
|
11035
|
+
this.Sr = n;
|
|
11036
11036
|
}));
|
|
11037
11037
|
}
|
|
11038
11038
|
On(e) {
|
|
11039
11039
|
// No-op since the memory mutation queue does not maintain a separate cache.
|
|
11040
11040
|
}
|
|
11041
11041
|
containsKey(e, t) {
|
|
11042
|
-
const n = new __PRIVATE_DocReference(t, 0), r = this.
|
|
11042
|
+
const n = new __PRIVATE_DocReference(t, 0), r = this.Sr.firstAfterOrEqual(n);
|
|
11043
11043
|
return PersistencePromise.resolve(t.isEqual(r && r.key));
|
|
11044
11044
|
}
|
|
11045
11045
|
performConsistencyCheck(e) {
|
|
@@ -11921,9 +11921,9 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11921
11921
|
/** The client metadata refresh task. */
|
|
11922
11922
|
this.Ti = null,
|
|
11923
11923
|
/** The last time we garbage collected the client metadata object store. */
|
|
11924
|
-
this.
|
|
11924
|
+
this.di = Number.NEGATIVE_INFINITY,
|
|
11925
11925
|
/** A listener to notify on primary state changes. */
|
|
11926
|
-
this.
|
|
11926
|
+
this.Ei = e => Promise.resolve(), !__PRIVATE_IndexedDbPersistence.D()) throw new FirestoreError(D.UNIMPLEMENTED, "This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");
|
|
11927
11927
|
this.referenceDelegate = new __PRIVATE_IndexedDbLruDelegateImpl(this, r), this.Ai = t + "main",
|
|
11928
11928
|
this.serializer = new __PRIVATE_LocalSerializer(_), this.Ri = new __PRIVATE_SimpleDb(this.Ai, this.hi, new __PRIVATE_SchemaConverter(this.serializer)),
|
|
11929
11929
|
this.$r = new __PRIVATE_IndexedDbGlobalsCache, this.Ur = new __PRIVATE_IndexedDbTargetCache(this.referenceDelegate, this.serializer),
|
|
@@ -11958,7 +11958,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11958
11958
|
*
|
|
11959
11959
|
* PORTING NOTE: This is only used for Web multi-tab.
|
|
11960
11960
|
*/ yi(e) {
|
|
11961
|
-
return this.
|
|
11961
|
+
return this.Ei = async t => {
|
|
11962
11962
|
if (this.started) return e(t);
|
|
11963
11963
|
}, e(this.isPrimary);
|
|
11964
11964
|
}
|
|
@@ -11999,9 +11999,9 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
11999
11999
|
inForeground: this.inForeground
|
|
12000
12000
|
}).next((() => {
|
|
12001
12001
|
if (this.isPrimary) return this.wi(e).next((e => {
|
|
12002
|
-
e || (this.isPrimary = !1, this.ui.enqueueRetryable((() => this.
|
|
12002
|
+
e || (this.isPrimary = !1, this.ui.enqueueRetryable((() => this.Ei(!1))));
|
|
12003
12003
|
}));
|
|
12004
|
-
})).next((() => this.
|
|
12004
|
+
})).next((() => this.bi(e))).next((t => this.isPrimary && !t ? this.Si(e).next((() => !1)) : !!t && this.Di(e).next((() => !0)))))).catch((e => {
|
|
12005
12005
|
if (__PRIVATE_isIndexedDbTransactionError(e))
|
|
12006
12006
|
// Proceed with the existing state. Any subsequent access to
|
|
12007
12007
|
// IndexedDB will verify the lease.
|
|
@@ -12011,7 +12011,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12011
12011
|
return __PRIVATE_logDebug("IndexedDbPersistence", "Releasing owner lease after error during lease refresh", e),
|
|
12012
12012
|
/* isPrimary= */ !1;
|
|
12013
12013
|
})).then((e => {
|
|
12014
|
-
this.isPrimary !== e && this.ui.enqueueRetryable((() => this.
|
|
12014
|
+
this.isPrimary !== e && this.ui.enqueueRetryable((() => this.Ei(e))), this.isPrimary = e;
|
|
12015
12015
|
}));
|
|
12016
12016
|
}
|
|
12017
12017
|
wi(e) {
|
|
@@ -12025,8 +12025,8 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12025
12025
|
* RemoteDocumentChanges and the ClientMetadata store based on the last update
|
|
12026
12026
|
* time of all clients.
|
|
12027
12027
|
*/ async Fi() {
|
|
12028
|
-
if (this.isPrimary && !this.Mi(this.
|
|
12029
|
-
this.
|
|
12028
|
+
if (this.isPrimary && !this.Mi(this.di, 18e5)) {
|
|
12029
|
+
this.di = Date.now();
|
|
12030
12030
|
const e = await this.runTransaction("maybeGarbageCollectMultiClientState", "readwrite-primary", (e => {
|
|
12031
12031
|
const t = __PRIVATE_getStore(e, "clientMetadata");
|
|
12032
12032
|
return t.U().next((e => {
|
|
@@ -12058,7 +12058,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12058
12058
|
* the client is eligible for the lease, but does not actually acquire it.
|
|
12059
12059
|
* May return 'false' even if there is no active leaseholder and another
|
|
12060
12060
|
* (foreground) client should become leaseholder instead.
|
|
12061
|
-
*/
|
|
12061
|
+
*/ bi(e) {
|
|
12062
12062
|
if (this.li) return PersistencePromise.resolve(!0);
|
|
12063
12063
|
return __PRIVATE_primaryClientStore(e).get("owner").next((t => {
|
|
12064
12064
|
// A client is eligible for the primary lease if:
|
|
@@ -12108,7 +12108,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12108
12108
|
// has obtained the primary lease.
|
|
12109
12109
|
await this.Ri.runTransaction("shutdown", "readwrite", [ "owner", "clientMetadata" ], (e => {
|
|
12110
12110
|
const t = new __PRIVATE_IndexedDbTransaction(e, __PRIVATE_ListenSequence.oe);
|
|
12111
|
-
return this.
|
|
12111
|
+
return this.Si(t).next((() => this.Ci(t)));
|
|
12112
12112
|
})), this.Ri.close(),
|
|
12113
12113
|
// Remove the entry marking the client as zombied from LocalStorage since
|
|
12114
12114
|
// we successfully deleted its metadata from IndexedDb.
|
|
@@ -12164,9 +12164,9 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12164
12164
|
// Do all transactions as readwrite against all object stores, since we
|
|
12165
12165
|
// are the only reader/writer.
|
|
12166
12166
|
return this.Ri.runTransaction(e, r, i, (r => (s = new __PRIVATE_IndexedDbTransaction(r, this.Qr ? this.Qr.next() : __PRIVATE_ListenSequence.oe),
|
|
12167
|
-
"readwrite-primary" === t ? this.wi(s).next((e => !!e || this.
|
|
12167
|
+
"readwrite-primary" === t ? this.wi(s).next((e => !!e || this.bi(s))).next((t => {
|
|
12168
12168
|
if (!t) throw __PRIVATE_logError(`Failed to obtain primary lease for action '${e}'.`),
|
|
12169
|
-
this.isPrimary = !1, this.ui.enqueueRetryable((() => this.
|
|
12169
|
+
this.isPrimary = !1, this.ui.enqueueRetryable((() => this.Ei(!1))), new FirestoreError(D.FAILED_PRECONDITION, C);
|
|
12170
12170
|
return n(s);
|
|
12171
12171
|
})).next((e => this.Di(s).next((() => e)))) : this.Ki(s).next((() => n(s)))))).then((e => (s.raiseOnCommittedEvent(),
|
|
12172
12172
|
e)));
|
|
@@ -12196,7 +12196,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12196
12196
|
static D() {
|
|
12197
12197
|
return __PRIVATE_SimpleDb.D();
|
|
12198
12198
|
}
|
|
12199
|
-
/** Checks the primary lease and removes it if we are the current primary. */
|
|
12199
|
+
/** Checks the primary lease and removes it if we are the current primary. */ Si(e) {
|
|
12200
12200
|
const t = __PRIVATE_primaryClientStore(e);
|
|
12201
12201
|
return t.get("owner").next((e => this.vi(e) ? (__PRIVATE_logDebug("IndexedDbPersistence", "Releasing primary lease."),
|
|
12202
12202
|
t.delete("owner")) : PersistencePromise.resolve()));
|
|
@@ -13008,9 +13008,9 @@ async function __PRIVATE_localStoreApplyBundledDocuments(e, t, n, r) {
|
|
|
13008
13008
|
const i = __PRIVATE_debugCast(e);
|
|
13009
13009
|
let s = __PRIVATE_documentKeySet(), o = __PRIVATE_mutableDocumentMap();
|
|
13010
13010
|
for (const e of n) {
|
|
13011
|
-
const n = t.
|
|
13011
|
+
const n = t.ds(e.metadata.name);
|
|
13012
13012
|
e.document && (s = s.add(n));
|
|
13013
|
-
const r = t.
|
|
13013
|
+
const r = t.Es(e);
|
|
13014
13014
|
r.setReadTime(t.As(e.metadata.readTime)), o = o.insert(n, r);
|
|
13015
13015
|
}
|
|
13016
13016
|
const _ = i.cs.newChangeBuffer({
|
|
@@ -13220,12 +13220,12 @@ class __PRIVATE_LocalClientState {
|
|
|
13220
13220
|
constructor(e, t, n, r, i) {
|
|
13221
13221
|
this.window = e, this.ui = t, this.persistenceKey = n, this.ps = r, this.syncEngine = null,
|
|
13222
13222
|
this.onlineStateHandler = null, this.sequenceNumberHandler = null, this.ys = this.ws.bind(this),
|
|
13223
|
-
this.
|
|
13223
|
+
this.bs = new SortedMap(__PRIVATE_primitiveComparator), this.started = !1,
|
|
13224
13224
|
/**
|
|
13225
13225
|
* Captures WebStorage events that occur before `start()` is called. These
|
|
13226
13226
|
* events are replayed once `WebStorageSharedClientState` is started.
|
|
13227
13227
|
*/
|
|
13228
|
-
this.
|
|
13228
|
+
this.Ss = [];
|
|
13229
13229
|
// Escape the special characters mentioned here:
|
|
13230
13230
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
|
|
13231
13231
|
const s = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
@@ -13250,7 +13250,7 @@ class __PRIVATE_LocalClientState {
|
|
|
13250
13250
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13251
13251
|
* See the License for the specific language governing permissions and
|
|
13252
13252
|
* limitations under the License.
|
|
13253
|
-
*/ (this.persistenceKey), this.
|
|
13253
|
+
*/ (this.persistenceKey), this.bs = this.bs.insert(this.ps, new __PRIVATE_LocalClientState),
|
|
13254
13254
|
this.Cs = new RegExp(`^firestore_clients_${s}_([^_]*)$`), this.Fs = new RegExp(`^firestore_mutations_${s}_(\\d+)(?:_(.*))?$`),
|
|
13255
13255
|
this.Ms = new RegExp(`^firestore_targets_${s}_(\\d+)$`), this.xs =
|
|
13256
13256
|
/** Assembles the key for the online state of the primary tab. */
|
|
@@ -13288,7 +13288,7 @@ class __PRIVATE_LocalClientState {
|
|
|
13288
13288
|
const e = this.getItem(createWebStorageClientStateKey(this.persistenceKey, t));
|
|
13289
13289
|
if (e) {
|
|
13290
13290
|
const n = __PRIVATE_RemoteClientState.Rs(t, e);
|
|
13291
|
-
n && (this.
|
|
13291
|
+
n && (this.bs = this.bs.insert(n.clientId, n));
|
|
13292
13292
|
}
|
|
13293
13293
|
}
|
|
13294
13294
|
this.Ns();
|
|
@@ -13299,8 +13299,8 @@ class __PRIVATE_LocalClientState {
|
|
|
13299
13299
|
const e = this.Ls(t);
|
|
13300
13300
|
e && this.Bs(e);
|
|
13301
13301
|
}
|
|
13302
|
-
for (const e of this.
|
|
13303
|
-
this.
|
|
13302
|
+
for (const e of this.Ss) this.ws(e);
|
|
13303
|
+
this.Ss = [],
|
|
13304
13304
|
// Register a window unload hook to remove the client metadata entry from
|
|
13305
13305
|
// WebStorage even if `shutdown()` was not called.
|
|
13306
13306
|
this.window.addEventListener("pagehide", (() => this.shutdown())), this.started = !0;
|
|
@@ -13309,11 +13309,11 @@ class __PRIVATE_LocalClientState {
|
|
|
13309
13309
|
this.setItem(this.vs, JSON.stringify(e));
|
|
13310
13310
|
}
|
|
13311
13311
|
getAllActiveQueryTargets() {
|
|
13312
|
-
return this.ks(this.
|
|
13312
|
+
return this.ks(this.bs);
|
|
13313
13313
|
}
|
|
13314
13314
|
isActiveQueryTarget(e) {
|
|
13315
13315
|
let t = !1;
|
|
13316
|
-
return this.
|
|
13316
|
+
return this.bs.forEach(((n, r) => {
|
|
13317
13317
|
r.activeTargetIds.has(e) && (t = !0);
|
|
13318
13318
|
})), t;
|
|
13319
13319
|
}
|
|
@@ -13434,12 +13434,12 @@ class __PRIVATE_LocalClientState {
|
|
|
13434
13434
|
const e = this.Xs(t.newValue);
|
|
13435
13435
|
await Promise.all(e.map((e => this.syncEngine.eo(e))));
|
|
13436
13436
|
}
|
|
13437
|
-
} else this.
|
|
13437
|
+
} else this.Ss.push(t);
|
|
13438
13438
|
}));
|
|
13439
13439
|
}
|
|
13440
13440
|
}
|
|
13441
13441
|
get Ks() {
|
|
13442
|
-
return this.
|
|
13442
|
+
return this.bs.get(this.ps);
|
|
13443
13443
|
}
|
|
13444
13444
|
Ns() {
|
|
13445
13445
|
this.setItem(this.Ds, this.Ks.Vs());
|
|
@@ -13512,13 +13512,13 @@ class __PRIVATE_LocalClientState {
|
|
|
13512
13512
|
return this.syncEngine.ro(e.targetId, e.state, e.error);
|
|
13513
13513
|
}
|
|
13514
13514
|
zs(e, t) {
|
|
13515
|
-
const n = t ? this.
|
|
13515
|
+
const n = t ? this.bs.insert(e, t) : this.bs.remove(e), r = this.ks(this.bs), i = this.ks(n), s = [], o = [];
|
|
13516
13516
|
return i.forEach((e => {
|
|
13517
13517
|
r.has(e) || s.push(e);
|
|
13518
13518
|
})), r.forEach((e => {
|
|
13519
13519
|
i.has(e) || o.push(e);
|
|
13520
13520
|
})), this.syncEngine.io(s, o).then((() => {
|
|
13521
|
-
this.
|
|
13521
|
+
this.bs = n;
|
|
13522
13522
|
}));
|
|
13523
13523
|
}
|
|
13524
13524
|
Bs(e) {
|
|
@@ -13527,7 +13527,7 @@ class __PRIVATE_LocalClientState {
|
|
|
13527
13527
|
// IndexedDb. If a client does not update their IndexedDb client state
|
|
13528
13528
|
// within 5 seconds, it is considered inactive and we don't emit an online
|
|
13529
13529
|
// state event.
|
|
13530
|
-
this.
|
|
13530
|
+
this.bs.get(e.clientId) && this.onlineStateHandler(e.onlineState);
|
|
13531
13531
|
}
|
|
13532
13532
|
ks(e) {
|
|
13533
13533
|
let t = __PRIVATE_targetIdSet();
|
|
@@ -13784,10 +13784,10 @@ class __PRIVATE_StreamBridge {
|
|
|
13784
13784
|
wo() {
|
|
13785
13785
|
this.Vo();
|
|
13786
13786
|
}
|
|
13787
|
-
|
|
13787
|
+
bo(e) {
|
|
13788
13788
|
this.fo(e);
|
|
13789
13789
|
}
|
|
13790
|
-
|
|
13790
|
+
So(e) {
|
|
13791
13791
|
this.po(e);
|
|
13792
13792
|
}
|
|
13793
13793
|
}
|
|
@@ -13851,7 +13851,7 @@ class __PRIVATE_RestConnection {
|
|
|
13851
13851
|
// SDK_VERSION is updated to different value at runtime depending on the entry point,
|
|
13852
13852
|
// so we need to get its value when we need it in a function.
|
|
13853
13853
|
function __PRIVATE_getGoogApiClientValue() {
|
|
13854
|
-
return "gl-js/ fire/" +
|
|
13854
|
+
return "gl-js/ fire/" + b;
|
|
13855
13855
|
}(),
|
|
13856
13856
|
// Content-Type: text/plain will avoid preflight requests which might
|
|
13857
13857
|
// mess with CORS and redirects by proxies. If we add custom headers
|
|
@@ -14001,10 +14001,10 @@ class __PRIVATE_RestConnection {
|
|
|
14001
14001
|
h || (__PRIVATE_logDebug(ge, `RPC '${e}' stream ${r} transport opened.`), P.yo());
|
|
14002
14002
|
})), __PRIVATE_unguardedEventListen(c, webchannelBlob.WebChannel.EventType.CLOSE, (() => {
|
|
14003
14003
|
h || (h = !0, __PRIVATE_logDebug(ge, `RPC '${e}' stream ${r} transport closed`),
|
|
14004
|
-
P.
|
|
14004
|
+
P.bo());
|
|
14005
14005
|
})), __PRIVATE_unguardedEventListen(c, webchannelBlob.WebChannel.EventType.ERROR, (t => {
|
|
14006
14006
|
h || (h = !0, __PRIVATE_logWarn(ge, `RPC '${e}' stream ${r} transport errored:`, t),
|
|
14007
|
-
P.
|
|
14007
|
+
P.bo(new FirestoreError(D.UNAVAILABLE, "The operation could not be completed")));
|
|
14008
14008
|
})), __PRIVATE_unguardedEventListen(c, webchannelBlob.WebChannel.EventType.MESSAGE, (t => {
|
|
14009
14009
|
var n;
|
|
14010
14010
|
if (!h) {
|
|
@@ -14035,8 +14035,8 @@ class __PRIVATE_RestConnection {
|
|
|
14035
14035
|
}(t), i = o.message;
|
|
14036
14036
|
void 0 === n && (n = D.INTERNAL, i = "Unknown error status: " + t + " with message " + o.message),
|
|
14037
14037
|
// Mark closed so no further events are propagated
|
|
14038
|
-
h = !0, P.
|
|
14039
|
-
} else __PRIVATE_logDebug(ge, `RPC '${e}' stream ${r} received:`, i), P.
|
|
14038
|
+
h = !0, P.bo(new FirestoreError(n, i)), c.close();
|
|
14039
|
+
} else __PRIVATE_logDebug(ge, `RPC '${e}' stream ${r} received:`, i), P.So(i);
|
|
14040
14040
|
}
|
|
14041
14041
|
})), __PRIVATE_unguardedEventListen(o, webchannelBlob.Event.STAT_EVENT, (t => {
|
|
14042
14042
|
t.stat === webchannelBlob.Stat.PROXY ? __PRIVATE_logDebug(ge, `RPC '${e}' stream ${r} detected buffering proxy`) : t.stat === webchannelBlob.Stat.NOPROXY && __PRIVATE_logDebug(ge, `RPC '${e}' stream ${r} detected no buffering proxy`);
|
|
@@ -14421,7 +14421,7 @@ class __PRIVATE_PersistentStream {
|
|
|
14421
14421
|
})), this.stream.mo((e => {
|
|
14422
14422
|
n((() => this.I_(e)));
|
|
14423
14423
|
})), this.stream.onMessage((e => {
|
|
14424
|
-
n((() => 1 == ++this.e_ ? this.
|
|
14424
|
+
n((() => 1 == ++this.e_ ? this.d_(e) : this.onNext(e)));
|
|
14425
14425
|
}));
|
|
14426
14426
|
}
|
|
14427
14427
|
i_() {
|
|
@@ -14465,7 +14465,7 @@ class __PRIVATE_PersistentStream {
|
|
|
14465
14465
|
T_(e, t) {
|
|
14466
14466
|
return this.connection.Bo("Listen", e, t);
|
|
14467
14467
|
}
|
|
14468
|
-
|
|
14468
|
+
d_(e) {
|
|
14469
14469
|
return this.onNext(e);
|
|
14470
14470
|
}
|
|
14471
14471
|
onNext(e) {
|
|
@@ -14479,7 +14479,7 @@ class __PRIVATE_PersistentStream {
|
|
|
14479
14479
|
const t = e.targetChange;
|
|
14480
14480
|
return t.targetIds && t.targetIds.length ? SnapshotVersion.min() : t.readTime ? __PRIVATE_fromVersion(t.readTime) : SnapshotVersion.min();
|
|
14481
14481
|
}(e);
|
|
14482
|
-
return this.listener.
|
|
14482
|
+
return this.listener.E_(t, n);
|
|
14483
14483
|
}
|
|
14484
14484
|
/**
|
|
14485
14485
|
* Registers interest in the results of the given target. If the target
|
|
@@ -14559,7 +14559,7 @@ class __PRIVATE_PersistentStream {
|
|
|
14559
14559
|
T_(e, t) {
|
|
14560
14560
|
return this.connection.Bo("Write", e, t);
|
|
14561
14561
|
}
|
|
14562
|
-
|
|
14562
|
+
d_(e) {
|
|
14563
14563
|
// Always capture the last stream token.
|
|
14564
14564
|
return __PRIVATE_hardAssert(!!e.streamToken), this.lastStreamToken = e.streamToken,
|
|
14565
14565
|
// The first response is always the handshake response
|
|
@@ -14667,13 +14667,13 @@ class __PRIVATE_OnlineStateTracker {
|
|
|
14667
14667
|
* maximum defined by MAX_WATCH_STREAM_FAILURES, we'll set the OnlineState to
|
|
14668
14668
|
* Offline.
|
|
14669
14669
|
*/
|
|
14670
|
-
this.
|
|
14670
|
+
this.b_ = 0,
|
|
14671
14671
|
/**
|
|
14672
14672
|
* A timer that elapses after ONLINE_STATE_TIMEOUT_MS, at which point we
|
|
14673
14673
|
* transition from OnlineState.Unknown to OnlineState.Offline without waiting
|
|
14674
14674
|
* for the stream to actually fail (MAX_WATCH_STREAM_FAILURES times).
|
|
14675
14675
|
*/
|
|
14676
|
-
this.
|
|
14676
|
+
this.S_ = null,
|
|
14677
14677
|
/**
|
|
14678
14678
|
* Whether the client should log a warning message if it fails to connect to
|
|
14679
14679
|
* the backend (initially true, cleared after a successful stream, or if we've
|
|
@@ -14688,7 +14688,7 @@ class __PRIVATE_OnlineStateTracker {
|
|
|
14688
14688
|
* If this is the first attempt, it sets the OnlineState to Unknown and starts
|
|
14689
14689
|
* the onlineStateTimer.
|
|
14690
14690
|
*/ v_() {
|
|
14691
|
-
0 === this.
|
|
14691
|
+
0 === this.b_ && (this.C_("Unknown" /* OnlineState.Unknown */), this.S_ = this.asyncQueue.enqueueAfterDelay("online_state_timeout" /* TimerId.OnlineStateTimeout */ , 1e4, (() => (this.S_ = null,
|
|
14692
14692
|
this.F_("Backend didn't respond within 10 seconds."), this.C_("Offline" /* OnlineState.Offline */),
|
|
14693
14693
|
Promise.resolve()))));
|
|
14694
14694
|
}
|
|
@@ -14698,8 +14698,8 @@ class __PRIVATE_OnlineStateTracker {
|
|
|
14698
14698
|
* allow multiple failures (based on MAX_WATCH_STREAM_FAILURES) before we
|
|
14699
14699
|
* actually transition to the 'Offline' state.
|
|
14700
14700
|
*/ M_(e) {
|
|
14701
|
-
"Online" /* OnlineState.Online */ === this.state ? this.C_("Unknown" /* OnlineState.Unknown */) : (this.
|
|
14702
|
-
this.
|
|
14701
|
+
"Online" /* OnlineState.Online */ === this.state ? this.C_("Unknown" /* OnlineState.Unknown */) : (this.b_++,
|
|
14702
|
+
this.b_ >= 1 && (this.x_(), this.F_(`Connection failed 1 times. Most recent error: ${e.toString()}`),
|
|
14703
14703
|
this.C_("Offline" /* OnlineState.Offline */)));
|
|
14704
14704
|
}
|
|
14705
14705
|
/**
|
|
@@ -14709,7 +14709,7 @@ class __PRIVATE_OnlineStateTracker {
|
|
|
14709
14709
|
* Offline heuristics, so must not be used in place of
|
|
14710
14710
|
* handleWatchStreamStart() and handleWatchStreamFailure().
|
|
14711
14711
|
*/ set(e) {
|
|
14712
|
-
this.x_(), this.
|
|
14712
|
+
this.x_(), this.b_ = 0, "Online" /* OnlineState.Online */ === e && (
|
|
14713
14713
|
// We've connected to watch at least once. Don't warn the developer
|
|
14714
14714
|
// about being offline going forward.
|
|
14715
14715
|
this.D_ = !1), this.C_(e);
|
|
@@ -14722,7 +14722,7 @@ class __PRIVATE_OnlineStateTracker {
|
|
|
14722
14722
|
this.D_ ? (__PRIVATE_logError(t), this.D_ = !1) : __PRIVATE_logDebug("OnlineStateTracker", t);
|
|
14723
14723
|
}
|
|
14724
14724
|
x_() {
|
|
14725
|
-
null !== this.
|
|
14725
|
+
null !== this.S_ && (this.S_.cancel(), this.S_ = null);
|
|
14726
14726
|
}
|
|
14727
14727
|
}
|
|
14728
14728
|
|
|
@@ -15154,7 +15154,7 @@ async function __PRIVATE_remoteStoreHandleCredentialChange(e, t) {
|
|
|
15154
15154
|
Eo: __PRIVATE_onWatchStreamConnected.bind(null, e),
|
|
15155
15155
|
Ro: __PRIVATE_onWatchStreamOpen.bind(null, e),
|
|
15156
15156
|
mo: __PRIVATE_onWatchStreamClose.bind(null, e),
|
|
15157
|
-
|
|
15157
|
+
E_: __PRIVATE_onWatchStreamChange.bind(null, e)
|
|
15158
15158
|
}), e.B_.push((async t => {
|
|
15159
15159
|
t ? (e.K_.s_(), __PRIVATE_shouldStartWatchStream(e) ? __PRIVATE_startWatchStream(e) : e.q_.set("Unknown" /* OnlineState.Unknown */)) : (await e.K_.stop(),
|
|
15160
15160
|
__PRIVATE_cleanUpWatchStreamState(e));
|
|
@@ -15742,13 +15742,13 @@ class __PRIVATE_QueryListener {
|
|
|
15742
15742
|
constructor(e) {
|
|
15743
15743
|
this.serializer = e;
|
|
15744
15744
|
}
|
|
15745
|
-
|
|
15745
|
+
ds(e) {
|
|
15746
15746
|
return fromName(this.serializer, e);
|
|
15747
15747
|
}
|
|
15748
15748
|
/**
|
|
15749
15749
|
* Converts a BundleDocument to a MutableDocument.
|
|
15750
|
-
*/
|
|
15751
|
-
return e.metadata.exists ? __PRIVATE_fromDocument(this.serializer, e.document, !1) : MutableDocument.newNoDocument(this.
|
|
15750
|
+
*/ Es(e) {
|
|
15751
|
+
return e.metadata.exists ? __PRIVATE_fromDocument(this.serializer, e.document, !1) : MutableDocument.newNoDocument(this.ds(e.metadata.name), this.As(e.metadata.readTime));
|
|
15752
15752
|
}
|
|
15753
15753
|
As(e) {
|
|
15754
15754
|
return __PRIVATE_fromVersion(e);
|
|
@@ -15790,7 +15790,7 @@ class __PRIVATE_QueryListener {
|
|
|
15790
15790
|
ha(e) {
|
|
15791
15791
|
const t = new Map, n = new __PRIVATE_BundleConverterImpl(this.serializer);
|
|
15792
15792
|
for (const r of e) if (r.metadata.queries) {
|
|
15793
|
-
const e = n.
|
|
15793
|
+
const e = n.ds(r.metadata.name);
|
|
15794
15794
|
for (const n of r.metadata.queries) {
|
|
15795
15795
|
const r = (t.get(n) || __PRIVATE_documentKeySet()).add(e);
|
|
15796
15796
|
t.set(n, r);
|
|
@@ -15864,7 +15864,7 @@ class __PRIVATE_RemovedLimboDocument {
|
|
|
15864
15864
|
constructor(e,
|
|
15865
15865
|
/** Documents included in the remote target */
|
|
15866
15866
|
t) {
|
|
15867
|
-
this.query = e, this.Ta = t, this.
|
|
15867
|
+
this.query = e, this.Ta = t, this.da = null, this.hasCachedResults = !1,
|
|
15868
15868
|
/**
|
|
15869
15869
|
* A flag whether the view is current with the backend. A view is considered
|
|
15870
15870
|
* current after it has seen the current flag from the backend and did not
|
|
@@ -15873,7 +15873,7 @@ class __PRIVATE_RemovedLimboDocument {
|
|
|
15873
15873
|
*/
|
|
15874
15874
|
this.current = !1,
|
|
15875
15875
|
/** Documents in the view but not in the remote target */
|
|
15876
|
-
this.
|
|
15876
|
+
this.Ea = __PRIVATE_documentKeySet(),
|
|
15877
15877
|
/** Document Keys that have local changes */
|
|
15878
15878
|
this.mutatedKeys = __PRIVATE_documentKeySet(), this.Aa = __PRIVATE_newQueryComparator(e),
|
|
15879
15879
|
this.Ra = new DocumentSet(this.Aa);
|
|
@@ -16018,10 +16018,10 @@ class __PRIVATE_RemovedLimboDocument {
|
|
|
16018
16018
|
* See the License for the specific language governing permissions and
|
|
16019
16019
|
* limitations under the License.
|
|
16020
16020
|
*/ (e.type, t.type) || this.Aa(e.doc, t.doc))), this.pa(n), r = null != r && r;
|
|
16021
|
-
const o = t && !r ? this.ya() : [], _ = 0 === this.
|
|
16021
|
+
const o = t && !r ? this.ya() : [], _ = 0 === this.Ea.size && this.current && !r ? 1 /* SyncState.Synced */ : 0 /* SyncState.Local */ , a = _ !== this.da;
|
|
16022
16022
|
// We are at synced state if there is no limbo docs are waiting to be resolved, view is current
|
|
16023
16023
|
// with the backend, and the query is not pending to reset due to existence filter mismatch.
|
|
16024
|
-
if (this.
|
|
16024
|
+
if (this.da = _, 0 !== s.length || a) {
|
|
16025
16025
|
return {
|
|
16026
16026
|
snapshot: new ViewSnapshot(this.query, e.Ra, i, s, e.mutatedKeys, 0 /* SyncState.Local */ === _, a,
|
|
16027
16027
|
/* excludesMetadataChanges= */ !1, !!n && n.resumeToken.approximateByteSize() > 0),
|
|
@@ -16054,7 +16054,7 @@ class __PRIVATE_RemovedLimboDocument {
|
|
|
16054
16054
|
}
|
|
16055
16055
|
/**
|
|
16056
16056
|
* Returns whether the doc for the given key should be in limbo.
|
|
16057
|
-
*/
|
|
16057
|
+
*/ ba(e) {
|
|
16058
16058
|
// If the remote end says it's part of this query, it's not in limbo.
|
|
16059
16059
|
return !this.Ta.has(e) && (
|
|
16060
16060
|
// The local store doesn't think it's a result, so it shouldn't be in limbo.
|
|
@@ -16072,15 +16072,15 @@ class __PRIVATE_RemovedLimboDocument {
|
|
|
16072
16072
|
if (!this.current) return [];
|
|
16073
16073
|
// TODO(klimt): Do this incrementally so that it's not quadratic when
|
|
16074
16074
|
// updating many documents.
|
|
16075
|
-
const e = this.
|
|
16076
|
-
this.
|
|
16077
|
-
this.
|
|
16075
|
+
const e = this.Ea;
|
|
16076
|
+
this.Ea = __PRIVATE_documentKeySet(), this.Ra.forEach((e => {
|
|
16077
|
+
this.ba(e.key) && (this.Ea = this.Ea.add(e.key));
|
|
16078
16078
|
}));
|
|
16079
16079
|
// Diff the new limbo docs with the old limbo docs.
|
|
16080
16080
|
const t = [];
|
|
16081
16081
|
return e.forEach((e => {
|
|
16082
|
-
this.
|
|
16083
|
-
})), this.
|
|
16082
|
+
this.Ea.has(e) || t.push(new __PRIVATE_RemovedLimboDocument(e));
|
|
16083
|
+
})), this.Ea.forEach((n => {
|
|
16084
16084
|
e.has(n) || t.push(new __PRIVATE_AddedLimboDocument(n));
|
|
16085
16085
|
})), t;
|
|
16086
16086
|
}
|
|
@@ -16104,8 +16104,8 @@ class __PRIVATE_RemovedLimboDocument {
|
|
|
16104
16104
|
* @returns The ViewChange that resulted from this synchronization.
|
|
16105
16105
|
*/
|
|
16106
16106
|
// PORTING NOTE: Multi-tab only.
|
|
16107
|
-
|
|
16108
|
-
this.Ta = e.Ts, this.
|
|
16107
|
+
Sa(e) {
|
|
16108
|
+
this.Ta = e.Ts, this.Ea = __PRIVATE_documentKeySet();
|
|
16109
16109
|
const t = this.ma(e.documents);
|
|
16110
16110
|
return this.applyChanges(t, /* limboResolutionEnabled= */ !0);
|
|
16111
16111
|
}
|
|
@@ -16116,7 +16116,7 @@ class __PRIVATE_RemovedLimboDocument {
|
|
|
16116
16116
|
*/
|
|
16117
16117
|
// PORTING NOTE: Multi-tab only.
|
|
16118
16118
|
Da() {
|
|
16119
|
-
return ViewSnapshot.fromInitialDocuments(this.query, this.Ra, this.mutatedKeys, 0 /* SyncState.Local */ === this.
|
|
16119
|
+
return ViewSnapshot.fromInitialDocuments(this.query, this.Ra, this.mutatedKeys, 0 /* SyncState.Local */ === this.da, this.hasCachedResults);
|
|
16120
16120
|
}
|
|
16121
16121
|
}
|
|
16122
16122
|
|
|
@@ -16417,7 +16417,7 @@ async function __PRIVATE_allocateTargetAndMaybeListen(e, t, n, r) {
|
|
|
16417
16417
|
// Run global snapshot listeners if a consistent snapshot has been emitted.
|
|
16418
16418
|
e.Z_(t) && (r = !0);
|
|
16419
16419
|
})), r && __PRIVATE_raiseSnapshotsInSyncEvent(n);
|
|
16420
|
-
}(r.eventManager, t), e.length && r.Ca.
|
|
16420
|
+
}(r.eventManager, t), e.length && r.Ca.E_(e), r.onlineState = t, r.isPrimaryClient && r.sharedClientState.setOnlineState(t);
|
|
16421
16421
|
}
|
|
16422
16422
|
}
|
|
16423
16423
|
|
|
@@ -16621,7 +16621,7 @@ async function __PRIVATE_syncEngineEmitNewSnapsAndNotifyLocalStore(e, t, n) {
|
|
|
16621
16621
|
s.push(t);
|
|
16622
16622
|
}
|
|
16623
16623
|
})));
|
|
16624
|
-
})), await Promise.all(o), r.Ca.
|
|
16624
|
+
})), await Promise.all(o), r.Ca.E_(i), await async function __PRIVATE_localStoreNotifyLocalViewChanges(e, t) {
|
|
16625
16625
|
const n = __PRIVATE_debugCast(e);
|
|
16626
16626
|
try {
|
|
16627
16627
|
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)))))))));
|
|
@@ -16683,7 +16683,7 @@ function __PRIVATE_syncEngineGetRemoteKeysForTarget(e, t) {
|
|
|
16683
16683
|
* from persistence.
|
|
16684
16684
|
*/ async function __PRIVATE_synchronizeViewAndComputeSnapshot(e, t) {
|
|
16685
16685
|
const n = __PRIVATE_debugCast(e), r = await __PRIVATE_localStoreExecuteQuery(n.localStore, t.query,
|
|
16686
|
-
/* usePreviousResults= */ !0), i = t.view.
|
|
16686
|
+
/* usePreviousResults= */ !0), i = t.view.Sa(r);
|
|
16687
16687
|
return n.isPrimaryClient && __PRIVATE_updateTrackedLimbos(n, t.targetId, i.wa),
|
|
16688
16688
|
i;
|
|
16689
16689
|
}
|
|
@@ -16799,7 +16799,7 @@ async function __PRIVATE_synchronizeQueryViewsAndRaiseSnapshots(e, t, n) {
|
|
|
16799
16799
|
}
|
|
16800
16800
|
i.push(t);
|
|
16801
16801
|
}
|
|
16802
|
-
return r.Ca.
|
|
16802
|
+
return r.Ca.E_(s), i;
|
|
16803
16803
|
}
|
|
16804
16804
|
|
|
16805
16805
|
/**
|
|
@@ -16882,7 +16882,7 @@ function __PRIVATE_ensureWatchCallbacks(e) {
|
|
|
16882
16882
|
return t.remoteStore.remoteSyncer.applyRemoteEvent = __PRIVATE_syncEngineApplyRemoteEvent.bind(null, t),
|
|
16883
16883
|
t.remoteStore.remoteSyncer.getRemoteKeysForTarget = __PRIVATE_syncEngineGetRemoteKeysForTarget.bind(null, t),
|
|
16884
16884
|
t.remoteStore.remoteSyncer.rejectListen = __PRIVATE_syncEngineRejectListen.bind(null, t),
|
|
16885
|
-
t.Ca.
|
|
16885
|
+
t.Ca.E_ = __PRIVATE_eventManagerOnWatchChange.bind(null, t.eventManager), t.Ca.$a = __PRIVATE_eventManagerOnWatchError.bind(null, t.eventManager),
|
|
16886
16886
|
t;
|
|
16887
16887
|
}
|
|
16888
16888
|
|
|
@@ -18587,10 +18587,10 @@ function doc(e, t, ...n) {
|
|
|
18587
18587
|
// automatically removed after they are run or canceled.
|
|
18588
18588
|
this.Tu = [],
|
|
18589
18589
|
// visible for testing
|
|
18590
|
-
this.
|
|
18590
|
+
this.du = null,
|
|
18591
18591
|
// Flag set while there's an outstanding AsyncQueue operation, used for
|
|
18592
18592
|
// assertion sanity-checks.
|
|
18593
|
-
this.
|
|
18593
|
+
this.Eu = !1,
|
|
18594
18594
|
// Enabled during shutdown on Safari to prevent future access to IndexedDB.
|
|
18595
18595
|
this.Au = !1,
|
|
18596
18596
|
// List of TimerIds to fast-forward delays for.
|
|
@@ -18671,8 +18671,8 @@ function doc(e, t, ...n) {
|
|
|
18671
18671
|
}
|
|
18672
18672
|
}
|
|
18673
18673
|
gu(e) {
|
|
18674
|
-
const t = this.mu.then((() => (this.
|
|
18675
|
-
this.
|
|
18674
|
+
const t = this.mu.then((() => (this.Eu = !0, e().catch((e => {
|
|
18675
|
+
this.du = e, this.Eu = !1;
|
|
18676
18676
|
const t =
|
|
18677
18677
|
/**
|
|
18678
18678
|
* Chrome includes Error.message in Error.stack. Other browsers do not.
|
|
@@ -18704,7 +18704,7 @@ function doc(e, t, ...n) {
|
|
|
18704
18704
|
// all further attempts to chain (via .then) will just short-circuit
|
|
18705
18705
|
// and return the rejected Promise.
|
|
18706
18706
|
throw __PRIVATE_logError("INTERNAL UNHANDLED ERROR: ", t), e;
|
|
18707
|
-
})).then((e => (this.
|
|
18707
|
+
})).then((e => (this.Eu = !1, e))))));
|
|
18708
18708
|
return this.mu = t, t;
|
|
18709
18709
|
}
|
|
18710
18710
|
enqueueAfterDelay(e, t, n) {
|
|
@@ -18715,7 +18715,7 @@ function doc(e, t, ...n) {
|
|
|
18715
18715
|
return this.Tu.push(r), r;
|
|
18716
18716
|
}
|
|
18717
18717
|
fu() {
|
|
18718
|
-
this.
|
|
18718
|
+
this.du && fail();
|
|
18719
18719
|
}
|
|
18720
18720
|
verifyOperationInProgress() {}
|
|
18721
18721
|
/**
|
|
@@ -18734,7 +18734,7 @@ function doc(e, t, ...n) {
|
|
|
18734
18734
|
/**
|
|
18735
18735
|
* For Tests: Determine if a delayed operation with a particular TimerId
|
|
18736
18736
|
* exists.
|
|
18737
|
-
*/
|
|
18737
|
+
*/ bu(e) {
|
|
18738
18738
|
for (const t of this.Tu) if (t.timerId === e) return !0;
|
|
18739
18739
|
return !1;
|
|
18740
18740
|
}
|
|
@@ -18744,7 +18744,7 @@ function doc(e, t, ...n) {
|
|
|
18744
18744
|
* @param lastTimerId - Delayed operations up to and including this TimerId
|
|
18745
18745
|
* will be drained. Pass TimerId.All to run all delayed operations.
|
|
18746
18746
|
* @returns a Promise that resolves once all operations have been run.
|
|
18747
|
-
*/
|
|
18747
|
+
*/ Su(e) {
|
|
18748
18748
|
// Note that draining may generate more delayed ops, so we do that first.
|
|
18749
18749
|
return this.wu().then((() => {
|
|
18750
18750
|
// Run ops in the same order they'd run if they ran naturally.
|
|
@@ -18890,7 +18890,7 @@ class LoadBundleTask {
|
|
|
18890
18890
|
* Constant used to indicate the LRU garbage collection should be disabled.
|
|
18891
18891
|
* Set this value as the `cacheSizeBytes` on the settings passed to the
|
|
18892
18892
|
* {@link Firestore} instance.
|
|
18893
|
-
*/ const
|
|
18893
|
+
*/ const be = -1;
|
|
18894
18894
|
|
|
18895
18895
|
/**
|
|
18896
18896
|
* The Cloud Firestore service interface.
|
|
@@ -19550,7 +19550,7 @@ class AggregateField {
|
|
|
19550
19550
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19551
19551
|
* See the License for the specific language governing permissions and
|
|
19552
19552
|
* limitations under the License.
|
|
19553
|
-
*/ const
|
|
19553
|
+
*/ const Se = /^__.*__$/;
|
|
19554
19554
|
|
|
19555
19555
|
/** The result of parsing document data (e.g. for a setData call). */ class ParsedSetData {
|
|
19556
19556
|
constructor(e, t, n) {
|
|
@@ -19661,7 +19661,7 @@ function __PRIVATE_isWrite(e) {
|
|
|
19661
19661
|
}
|
|
19662
19662
|
Ou(e) {
|
|
19663
19663
|
if (0 === e.length) throw this.Bu("Document fields must not be empty");
|
|
19664
|
-
if (__PRIVATE_isWrite(this.Cu) &&
|
|
19664
|
+
if (__PRIVATE_isWrite(this.Cu) && Se.test(e)) throw this.Bu('Document fields cannot begin and end with "__"');
|
|
19665
19665
|
}
|
|
19666
19666
|
}
|
|
19667
19667
|
|
|
@@ -22216,7 +22216,7 @@ let Fe = null;
|
|
|
22216
22216
|
* @packageDocumentation
|
|
22217
22217
|
*/ !function __PRIVATE_registerFirestore(e, t = !0) {
|
|
22218
22218
|
!function __PRIVATE_setSDKVersion(e) {
|
|
22219
|
-
|
|
22219
|
+
b = e;
|
|
22220
22220
|
}(app.SDK_VERSION), app._registerComponent(new component.Component("firestore", ((e, {instanceIdentifier: n, options: r}) => {
|
|
22221
22221
|
const i = e.getProvider("app").getImmediate(), s = new Firestore(new __PRIVATE_FirebaseAuthCredentialsProvider(e.getProvider("auth-internal")), new __PRIVATE_FirebaseAppCheckTokenProvider(e.getProvider("app-check-internal")), function __PRIVATE_databaseIdFromApp(e, t) {
|
|
22222
22222
|
if (!Object.prototype.hasOwnProperty.apply(e.options, [ "projectId" ])) throw new FirestoreError(D.INVALID_ARGUMENT, '"projectId" not provided in firebase.initializeApp.');
|
|
@@ -22225,16 +22225,16 @@ let Fe = null;
|
|
|
22225
22225
|
return r = Object.assign({
|
|
22226
22226
|
useFetchStreams: t
|
|
22227
22227
|
}, r), s._setSettings(r), s;
|
|
22228
|
-
}), "PUBLIC").setMultipleInstances(!0)), app.registerVersion(w, "4.7.4-canary.
|
|
22228
|
+
}), "PUBLIC").setMultipleInstances(!0)), app.registerVersion(w, "4.7.4-canary.4db3d3e7b", e),
|
|
22229
22229
|
// BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation
|
|
22230
|
-
app.registerVersion(w, "4.7.4-canary.
|
|
22230
|
+
app.registerVersion(w, "4.7.4-canary.4db3d3e7b", "cjs2017");
|
|
22231
22231
|
}();
|
|
22232
22232
|
|
|
22233
22233
|
exports.AbstractUserDataWriter = AbstractUserDataWriter;
|
|
22234
22234
|
exports.AggregateField = AggregateField;
|
|
22235
22235
|
exports.AggregateQuerySnapshot = AggregateQuerySnapshot;
|
|
22236
22236
|
exports.Bytes = Bytes;
|
|
22237
|
-
exports.CACHE_SIZE_UNLIMITED =
|
|
22237
|
+
exports.CACHE_SIZE_UNLIMITED = be;
|
|
22238
22238
|
exports.CollectionReference = CollectionReference;
|
|
22239
22239
|
exports.DocumentReference = DocumentReference;
|
|
22240
22240
|
exports.DocumentSnapshot = DocumentSnapshot;
|