@firebase/firestore 3.13.0-canary.f2fb56fc0 → 3.13.0-canary.f3067f72d
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/firestore/src/global_index.d.ts +15 -1
- package/dist/firestore/src/lite-api/types.d.ts +1 -1
- package/dist/firestore/src/util/testing_hooks.d.ts +14 -0
- package/dist/firestore/test/integration/util/helpers.d.ts +63 -16
- package/dist/firestore/test/integration/util/internal_helpers.d.ts +2 -1
- package/dist/firestore/test/integration/util/testing_hooks_util.d.ts +1 -0
- package/dist/index.cjs.js +150 -136
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm2017.js +150 -136
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +147 -133
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +27 -21
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +27 -21
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +150 -136
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +15 -1
- package/dist/lite/firestore/src/lite-api/types.d.ts +1 -1
- package/dist/lite/firestore/src/util/testing_hooks.d.ts +14 -0
- package/dist/lite/firestore/test/integration/util/helpers.d.ts +63 -16
- package/dist/lite/firestore/test/integration/util/internal_helpers.d.ts +2 -1
- package/dist/lite/firestore/test/integration/util/testing_hooks_util.d.ts +1 -0
- 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.d.ts +1 -1
- 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/lite/internal.d.ts +1 -1
- package/dist/lite/packages/firestore/src/lite-api/types.d.ts +1 -1
- package/dist/lite/packages/firestore/src/util/testing_hooks.d.ts +14 -0
- package/dist/lite/packages/firestore/test/integration/util/helpers.d.ts +63 -16
- package/dist/lite/packages/firestore/test/integration/util/internal_helpers.d.ts +2 -1
- package/dist/lite/packages/firestore/test/integration/util/testing_hooks_util.d.ts +1 -0
- package/dist/lite/private.d.ts +1 -1
- package/dist/packages/firestore/src/lite-api/types.d.ts +1 -1
- package/dist/packages/firestore/src/util/testing_hooks.d.ts +14 -0
- package/dist/packages/firestore/test/integration/util/helpers.d.ts +63 -16
- package/dist/packages/firestore/test/integration/util/internal_helpers.d.ts +2 -1
- package/dist/packages/firestore/test/integration/util/testing_hooks_util.d.ts +1 -0
- package/dist/private.d.ts +15 -1
- package/package.json +9 -9
package/dist/index.esm5.js
CHANGED
|
@@ -70,7 +70,7 @@ P.MOCK_USER = new P("mock-user");
|
|
|
70
70
|
* See the License for the specific language governing permissions and
|
|
71
71
|
* limitations under the License.
|
|
72
72
|
*/
|
|
73
|
-
var O = "9.23.0-canary.
|
|
73
|
+
var O = "9.23.0-canary.f3067f72d", R = new l("@firebase/firestore");
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* @license
|
|
@@ -5637,7 +5637,7 @@ var yi = /** @class */ function() {
|
|
|
5637
5637
|
// Return whether the bit on the given index in the bitmap is set to 1.
|
|
5638
5638
|
t.prototype.Ve = function(t) {
|
|
5639
5639
|
return 0 != (this.bitmap[Math.floor(t / 8)] & 1 << t % 8);
|
|
5640
|
-
}, t.prototype.
|
|
5640
|
+
}, t.prototype.mightContain = function(t) {
|
|
5641
5641
|
// Empty bitmap should always return false on membership check.
|
|
5642
5642
|
if (0 === this.de) return !1;
|
|
5643
5643
|
for (var e = mi(vi(t)), n = e[0], r = e[1], i = 0; i < this.hashCount; i++) {
|
|
@@ -5654,9 +5654,9 @@ var yi = /** @class */ function() {
|
|
|
5654
5654
|
}, t.prototype.insert = function(t) {
|
|
5655
5655
|
if (0 !== this.de) for (var e = mi(vi(t)), n = e[0], r = e[1], i = 0; i < this.hashCount; i++) {
|
|
5656
5656
|
var o = this.Re(n, r, i);
|
|
5657
|
-
this.
|
|
5657
|
+
this.me(o);
|
|
5658
5658
|
}
|
|
5659
|
-
}, t.prototype.
|
|
5659
|
+
}, t.prototype.me = function(t) {
|
|
5660
5660
|
var e = Math.floor(t / 8), n = t % 8;
|
|
5661
5661
|
this.bitmap[e] |= 1 << n;
|
|
5662
5662
|
}, t;
|
|
@@ -5758,9 +5758,9 @@ n,
|
|
|
5758
5758
|
* document went out of view without the server sending a new document.
|
|
5759
5759
|
*/
|
|
5760
5760
|
r) {
|
|
5761
|
-
this.
|
|
5761
|
+
this.fe = t, this.removedTargetIds = e, this.key = n, this.ge = r;
|
|
5762
5762
|
}, _i = function(t, e) {
|
|
5763
|
-
this.targetId = t, this.
|
|
5763
|
+
this.targetId = t, this.pe = e;
|
|
5764
5764
|
}, Ti = function(
|
|
5765
5765
|
/** What kind of change occurred to the watch target. */
|
|
5766
5766
|
t,
|
|
@@ -5782,22 +5782,22 @@ n
|
|
|
5782
5782
|
* The number of pending responses (adds or removes) that we are waiting on.
|
|
5783
5783
|
* We only consider targets active that have no pending responses.
|
|
5784
5784
|
*/
|
|
5785
|
-
this.
|
|
5785
|
+
this.ye = 0,
|
|
5786
5786
|
/**
|
|
5787
5787
|
* Keeps track of the document changes since the last raised snapshot.
|
|
5788
5788
|
*
|
|
5789
5789
|
* These changes are continuously updated as we receive document updates and
|
|
5790
5790
|
* always reflect the current set of changes against the last issued snapshot.
|
|
5791
5791
|
*/
|
|
5792
|
-
this.
|
|
5792
|
+
this.we = Ci(),
|
|
5793
5793
|
/** See public getters for explanations of these fields. */
|
|
5794
|
-
this.
|
|
5794
|
+
this.Se = Pe.EMPTY_BYTE_STRING, this.be = !1,
|
|
5795
5795
|
/**
|
|
5796
5796
|
* Whether this target state should be included in the next snapshot. We
|
|
5797
5797
|
* initialize to true so that newly-added targets are included in the next
|
|
5798
5798
|
* RemoteEvent.
|
|
5799
5799
|
*/
|
|
5800
|
-
this.
|
|
5800
|
+
this.De = !0;
|
|
5801
5801
|
}
|
|
5802
5802
|
return Object.defineProperty(t.prototype, "current", {
|
|
5803
5803
|
/**
|
|
@@ -5809,25 +5809,25 @@ n
|
|
|
5809
5809
|
* stream.
|
|
5810
5810
|
*/
|
|
5811
5811
|
get: function() {
|
|
5812
|
-
return this.
|
|
5812
|
+
return this.be;
|
|
5813
5813
|
},
|
|
5814
5814
|
enumerable: !1,
|
|
5815
5815
|
configurable: !0
|
|
5816
5816
|
}), Object.defineProperty(t.prototype, "resumeToken", {
|
|
5817
5817
|
/** The last resume token sent to us for this target. */ get: function() {
|
|
5818
|
-
return this.
|
|
5818
|
+
return this.Se;
|
|
5819
5819
|
},
|
|
5820
5820
|
enumerable: !1,
|
|
5821
5821
|
configurable: !0
|
|
5822
|
-
}), Object.defineProperty(t.prototype, "
|
|
5822
|
+
}), Object.defineProperty(t.prototype, "ve", {
|
|
5823
5823
|
/** Whether this target has pending target adds or target removes. */ get: function() {
|
|
5824
|
-
return 0 !== this.
|
|
5824
|
+
return 0 !== this.ye;
|
|
5825
5825
|
},
|
|
5826
5826
|
enumerable: !1,
|
|
5827
5827
|
configurable: !0
|
|
5828
|
-
}), Object.defineProperty(t.prototype, "
|
|
5828
|
+
}), Object.defineProperty(t.prototype, "Ce", {
|
|
5829
5829
|
/** Whether we have modified any state that should trigger a snapshot. */ get: function() {
|
|
5830
|
-
return this.
|
|
5830
|
+
return this.De;
|
|
5831
5831
|
},
|
|
5832
5832
|
enumerable: !1,
|
|
5833
5833
|
configurable: !0
|
|
@@ -5836,8 +5836,8 @@ n
|
|
|
5836
5836
|
* Applies the resume token to the TargetChange, but only when it has a new
|
|
5837
5837
|
* value. Empty resumeTokens are discarded.
|
|
5838
5838
|
*/
|
|
5839
|
-
t.prototype.
|
|
5840
|
-
t.approximateByteSize() > 0 && (this.
|
|
5839
|
+
t.prototype.Fe = function(t) {
|
|
5840
|
+
t.approximateByteSize() > 0 && (this.De = !0, this.Se = t);
|
|
5841
5841
|
},
|
|
5842
5842
|
/**
|
|
5843
5843
|
* Creates a target change from the current set of changes.
|
|
@@ -5845,9 +5845,9 @@ n
|
|
|
5845
5845
|
* To reset the document changes after raising this snapshot, call
|
|
5846
5846
|
* `clearPendingChanges()`.
|
|
5847
5847
|
*/
|
|
5848
|
-
t.prototype.
|
|
5848
|
+
t.prototype.Me = function() {
|
|
5849
5849
|
var t = Ir(), e = Ir(), n = Ir();
|
|
5850
|
-
return this.
|
|
5850
|
+
return this.we.forEach((function(r, i) {
|
|
5851
5851
|
switch (i) {
|
|
5852
5852
|
case 0 /* ChangeType.Added */ :
|
|
5853
5853
|
t = t.add(r);
|
|
@@ -5864,70 +5864,70 @@ n
|
|
|
5864
5864
|
default:
|
|
5865
5865
|
B();
|
|
5866
5866
|
}
|
|
5867
|
-
})), new bi(this.
|
|
5867
|
+
})), new bi(this.Se, this.be, t, e, n);
|
|
5868
5868
|
},
|
|
5869
5869
|
/**
|
|
5870
5870
|
* Resets the document changes and sets `hasPendingChanges` to false.
|
|
5871
5871
|
*/
|
|
5872
|
-
t.prototype.
|
|
5873
|
-
this.
|
|
5874
|
-
}, t.prototype.
|
|
5875
|
-
this.
|
|
5876
|
-
}, t.prototype.
|
|
5877
|
-
this.
|
|
5872
|
+
t.prototype.xe = function() {
|
|
5873
|
+
this.De = !1, this.we = Ci();
|
|
5874
|
+
}, t.prototype.Oe = function(t, e) {
|
|
5875
|
+
this.De = !0, this.we = this.we.insert(t, e);
|
|
5876
|
+
}, t.prototype.Ne = function(t) {
|
|
5877
|
+
this.De = !0, this.we = this.we.remove(t);
|
|
5878
|
+
}, t.prototype.Be = function() {
|
|
5879
|
+
this.ye += 1;
|
|
5878
5880
|
}, t.prototype.Le = function() {
|
|
5879
|
-
this.
|
|
5881
|
+
this.ye -= 1;
|
|
5880
5882
|
}, t.prototype.ke = function() {
|
|
5881
|
-
this.
|
|
5882
|
-
}, t.prototype.qe = function() {
|
|
5883
|
-
this.ve = !0, this.De = !0;
|
|
5883
|
+
this.De = !0, this.be = !0;
|
|
5884
5884
|
}, t;
|
|
5885
5885
|
}(), Si = /** @class */ function() {
|
|
5886
5886
|
function t(t) {
|
|
5887
|
-
this.
|
|
5887
|
+
this.qe = t,
|
|
5888
5888
|
/** The internal state of all tracked targets. */
|
|
5889
|
-
this.
|
|
5889
|
+
this.Qe = new Map,
|
|
5890
5890
|
/** Keeps track of the documents to update since the last raised snapshot. */
|
|
5891
|
-
this
|
|
5891
|
+
this.Ke = fr(),
|
|
5892
5892
|
/** A mapping of document keys to their set of target IDs. */
|
|
5893
|
-
this
|
|
5893
|
+
this.$e = Di(),
|
|
5894
5894
|
/**
|
|
5895
5895
|
* A map of targets with existence filter mismatches. These targets are
|
|
5896
5896
|
* known to be inconsistent and their listens needs to be re-established by
|
|
5897
5897
|
* RemoteStore.
|
|
5898
5898
|
*/
|
|
5899
|
-
this.
|
|
5899
|
+
this.Ue = new Te(ot)
|
|
5900
5900
|
/**
|
|
5901
5901
|
* Processes and adds the DocumentWatchChange to the current set of changes.
|
|
5902
5902
|
*/;
|
|
5903
5903
|
}
|
|
5904
|
-
return t.prototype.
|
|
5905
|
-
for (var e = 0, n = t.
|
|
5904
|
+
return t.prototype.We = function(t) {
|
|
5905
|
+
for (var e = 0, n = t.fe; e < n.length; e++) {
|
|
5906
5906
|
var r = n[e];
|
|
5907
|
-
t.
|
|
5907
|
+
t.ge && t.ge.isFoundDocument() ? this.Ge(r, t.ge) : this.ze(r, t.key, t.ge);
|
|
5908
5908
|
}
|
|
5909
5909
|
for (var i = 0, o = t.removedTargetIds; i < o.length; i++) {
|
|
5910
5910
|
var a = o[i];
|
|
5911
|
-
this.
|
|
5911
|
+
this.ze(a, t.key, t.ge);
|
|
5912
5912
|
}
|
|
5913
5913
|
},
|
|
5914
|
-
/** Processes and adds the WatchTargetChange to the current set of changes. */ t.prototype.
|
|
5914
|
+
/** Processes and adds the WatchTargetChange to the current set of changes. */ t.prototype.je = function(t) {
|
|
5915
5915
|
var e = this;
|
|
5916
5916
|
this.forEachTarget(t, (function(n) {
|
|
5917
|
-
var r = e.
|
|
5917
|
+
var r = e.He(n);
|
|
5918
5918
|
switch (t.state) {
|
|
5919
5919
|
case 0 /* WatchTargetChangeState.NoChange */ :
|
|
5920
|
-
e.
|
|
5920
|
+
e.Je(n) && r.Fe(t.resumeToken);
|
|
5921
5921
|
break;
|
|
5922
5922
|
|
|
5923
5923
|
case 1 /* WatchTargetChangeState.Added */ :
|
|
5924
5924
|
// We need to decrement the number of pending acks needed from watch
|
|
5925
5925
|
// for this targetId.
|
|
5926
|
-
r.
|
|
5926
|
+
r.Le(), r.ve ||
|
|
5927
5927
|
// We have a freshly added target, so we need to reset any state
|
|
5928
5928
|
// that we had previously. This can happen e.g. when remove and add
|
|
5929
5929
|
// back a target for existence filter mismatches.
|
|
5930
|
-
r.
|
|
5930
|
+
r.xe(), r.Fe(t.resumeToken);
|
|
5931
5931
|
break;
|
|
5932
5932
|
|
|
5933
5933
|
case 2 /* WatchTargetChangeState.Removed */ :
|
|
@@ -5935,19 +5935,19 @@ n
|
|
|
5935
5935
|
// remove any target changes.
|
|
5936
5936
|
// We need to decrement the number of pending acks needed from watch
|
|
5937
5937
|
// for this targetId.
|
|
5938
|
-
r.
|
|
5938
|
+
r.Le(), r.ve || e.removeTarget(n);
|
|
5939
5939
|
break;
|
|
5940
5940
|
|
|
5941
5941
|
case 3 /* WatchTargetChangeState.Current */ :
|
|
5942
|
-
e.
|
|
5942
|
+
e.Je(n) && (r.ke(), r.Fe(t.resumeToken));
|
|
5943
5943
|
break;
|
|
5944
5944
|
|
|
5945
5945
|
case 4 /* WatchTargetChangeState.Reset */ :
|
|
5946
|
-
e.
|
|
5946
|
+
e.Je(n) && (
|
|
5947
5947
|
// Reset the target and synthesizes removes for all existing
|
|
5948
5948
|
// documents. The backend will re-add any documents that still
|
|
5949
5949
|
// match the target before it sends the next global snapshot.
|
|
5950
|
-
e.
|
|
5950
|
+
e.Ye(n), r.Fe(t.resumeToken));
|
|
5951
5951
|
break;
|
|
5952
5952
|
|
|
5953
5953
|
default:
|
|
@@ -5962,8 +5962,8 @@ n
|
|
|
5962
5962
|
*/
|
|
5963
5963
|
t.prototype.forEachTarget = function(t, e) {
|
|
5964
5964
|
var n = this;
|
|
5965
|
-
t.targetIds.length > 0 ? t.targetIds.forEach(e) : this.
|
|
5966
|
-
n.
|
|
5965
|
+
t.targetIds.length > 0 ? t.targetIds.forEach(e) : this.Qe.forEach((function(t, r) {
|
|
5966
|
+
n.Je(r) && e(r);
|
|
5967
5967
|
}));
|
|
5968
5968
|
},
|
|
5969
5969
|
/**
|
|
@@ -5971,45 +5971,45 @@ n
|
|
|
5971
5971
|
* Targets that are invalidated by filter mismatches are added to
|
|
5972
5972
|
* `pendingTargetResets`.
|
|
5973
5973
|
*/
|
|
5974
|
-
t.prototype.
|
|
5975
|
-
var e, n = t.targetId,
|
|
5976
|
-
if (
|
|
5977
|
-
var
|
|
5978
|
-
if (zn(
|
|
5974
|
+
t.prototype.Ze = function(t) {
|
|
5975
|
+
var e, n, r = t.targetId, i = t.pe.count, o = this.Xe(r);
|
|
5976
|
+
if (o) {
|
|
5977
|
+
var a = o.target;
|
|
5978
|
+
if (zn(a)) if (0 === i) {
|
|
5979
5979
|
// The existence filter told us the document does not exist. We deduce
|
|
5980
5980
|
// that this document does not exist and apply a deleted document to
|
|
5981
5981
|
// our updates. Without applying this deleted document there might be
|
|
5982
5982
|
// another query that will raise this document as part of a snapshot
|
|
5983
5983
|
// until it is resolved, essentially exposing inconsistency between
|
|
5984
5984
|
// queries.
|
|
5985
|
-
var
|
|
5986
|
-
this.
|
|
5987
|
-
} else z(1 ===
|
|
5988
|
-
var
|
|
5985
|
+
var u = new pt(a.path);
|
|
5986
|
+
this.ze(r, u, dn.newNoDocument(u, ct.min()));
|
|
5987
|
+
} else z(1 === i); else {
|
|
5988
|
+
var s = this.et(r);
|
|
5989
5989
|
// Existence filter mismatch. Mark the documents as being in limbo, and
|
|
5990
5990
|
// raise a snapshot with `isFromCache:true`.
|
|
5991
|
-
if (
|
|
5991
|
+
if (s !== i) {
|
|
5992
5992
|
// Apply bloom filter to identify and mark removed documents.
|
|
5993
|
-
var
|
|
5994
|
-
if (0 /* BloomFilterApplicationStatus.Success */ !==
|
|
5993
|
+
var c = this.tt(t, s);
|
|
5994
|
+
if (0 /* BloomFilterApplicationStatus.Success */ !== c.status) {
|
|
5995
5995
|
// If bloom filter application fails, we reset the mapping and
|
|
5996
5996
|
// trigger re-run of the query.
|
|
5997
|
-
this.
|
|
5998
|
-
var
|
|
5999
|
-
this.
|
|
5997
|
+
this.Ye(r);
|
|
5998
|
+
var l = 2 /* BloomFilterApplicationStatus.FalsePositive */ === c.status ? "TargetPurposeExistenceFilterMismatchBloom" /* TargetPurpose.ExistenceFilterMismatchBloom */ : "TargetPurposeExistenceFilterMismatch" /* TargetPurpose.ExistenceFilterMismatch */;
|
|
5999
|
+
this.Ue = this.Ue.insert(r, l);
|
|
6000
6000
|
}
|
|
6001
|
-
null === (e = hi.instance) || void 0 === e || e.notifyOnExistenceFilterMismatch(function(t, e, n) {
|
|
6002
|
-
var
|
|
6003
|
-
localCacheCount:
|
|
6004
|
-
existenceFilterCount:
|
|
6005
|
-
},
|
|
6006
|
-
return
|
|
6001
|
+
null === (e = hi.instance) || void 0 === e || e.notifyOnExistenceFilterMismatch(function(t, e, n, r) {
|
|
6002
|
+
var i, o, a, u, s, c, l = {
|
|
6003
|
+
localCacheCount: n,
|
|
6004
|
+
existenceFilterCount: r.count
|
|
6005
|
+
}, h = r.unchangedNames;
|
|
6006
|
+
return h && (l.bloomFilter = {
|
|
6007
6007
|
applied: 0 /* BloomFilterApplicationStatus.Success */ === t,
|
|
6008
|
-
hashCount: null !== (
|
|
6009
|
-
bitmapLength: null !== (
|
|
6010
|
-
padding: null !== (
|
|
6011
|
-
}),
|
|
6012
|
-
}(
|
|
6008
|
+
hashCount: null !== (i = null == h ? void 0 : h.hashCount) && void 0 !== i ? i : 0,
|
|
6009
|
+
bitmapLength: null !== (u = null === (a = null === (o = null == h ? void 0 : h.bits) || void 0 === o ? void 0 : o.bitmap) || void 0 === a ? void 0 : a.length) && void 0 !== u ? u : 0,
|
|
6010
|
+
padding: null !== (c = null === (s = null == h ? void 0 : h.bits) || void 0 === s ? void 0 : s.padding) && void 0 !== c ? c : 0
|
|
6011
|
+
}, e && (l.bloomFilter.mightContain = e)), l;
|
|
6012
|
+
}(c.status, null !== (n = c.nt) && void 0 !== n ? n : null, s, t.pe));
|
|
6013
6013
|
}
|
|
6014
6014
|
}
|
|
6015
6015
|
}
|
|
@@ -6018,35 +6018,49 @@ n
|
|
|
6018
6018
|
* Apply bloom filter to remove the deleted documents, and return the
|
|
6019
6019
|
* application status.
|
|
6020
6020
|
*/
|
|
6021
|
-
t.prototype.
|
|
6022
|
-
var n = t.
|
|
6023
|
-
if (!
|
|
6024
|
-
|
|
6021
|
+
t.prototype.tt = function(t, e) {
|
|
6022
|
+
var n = this, r = t.pe, i = r.unchangedNames, o = r.count;
|
|
6023
|
+
if (!i || !i.bits) return {
|
|
6024
|
+
status: 1
|
|
6025
|
+
/* BloomFilterApplicationStatus.Skipped */ };
|
|
6026
|
+
var a, u, s = i.bits, c = s.bitmap, l = void 0 === c ? "" : c, h = s.padding, f = void 0 === h ? 0 : h, d = i.hashCount, p = void 0 === d ? 0 : d;
|
|
6025
6027
|
try {
|
|
6026
|
-
|
|
6028
|
+
a = Fe(l).toUint8Array();
|
|
6027
6029
|
} catch (t) {
|
|
6028
6030
|
if (t instanceof Ae) return q("Decoding the base64 bloom filter in existence filter failed (" + t.message + "); ignoring the bloom filter and falling back to full re-query."),
|
|
6029
|
-
|
|
6031
|
+
{
|
|
6032
|
+
status: 1
|
|
6033
|
+
/* BloomFilterApplicationStatus.Skipped */ };
|
|
6030
6034
|
throw t;
|
|
6031
6035
|
}
|
|
6032
6036
|
try {
|
|
6033
6037
|
// BloomFilter throws error if the inputs are invalid.
|
|
6034
|
-
|
|
6038
|
+
u = new yi(a, f, p);
|
|
6035
6039
|
} catch (t) {
|
|
6036
6040
|
return q(t instanceof gi ? "BloomFilter error: " : "Applying bloom filter failed: ", t),
|
|
6037
|
-
|
|
6041
|
+
{
|
|
6042
|
+
status: 1
|
|
6043
|
+
/* BloomFilterApplicationStatus.Skipped */ };
|
|
6038
6044
|
}
|
|
6039
|
-
|
|
6045
|
+
var v = function(t) {
|
|
6046
|
+
var e = n.qe.rt();
|
|
6047
|
+
return u.mightContain("projects/".concat(e.projectId, "/databases/").concat(e.database, "/documents/").concat(t));
|
|
6048
|
+
};
|
|
6049
|
+
return 0 === u.de ? {
|
|
6050
|
+
status: 1
|
|
6051
|
+
/* BloomFilterApplicationStatus.Skipped */ } : {
|
|
6052
|
+
status: o === e - this.it(t.targetId, v) ? 0 /* BloomFilterApplicationStatus.Success */ : 2 /* BloomFilterApplicationStatus.FalsePositive */ ,
|
|
6053
|
+
nt: v
|
|
6054
|
+
};
|
|
6040
6055
|
},
|
|
6041
6056
|
/**
|
|
6042
6057
|
* Filter out removed documents based on bloom filter membership result and
|
|
6043
6058
|
* return number of documents removed.
|
|
6044
6059
|
*/
|
|
6045
|
-
t.prototype.
|
|
6046
|
-
var n = this, r = this.
|
|
6060
|
+
t.prototype.it = function(t, e) {
|
|
6061
|
+
var n = this, r = this.qe.getRemoteKeysForTarget(t), i = 0;
|
|
6047
6062
|
return r.forEach((function(r) {
|
|
6048
|
-
|
|
6049
|
-
e.me(a) || (n.je(t, r, /*updatedDocument=*/ null), i++);
|
|
6063
|
+
e(r.path.canonicalString()) || (n.ze(t, r, /*updatedDocument=*/ null), i++);
|
|
6050
6064
|
})), i;
|
|
6051
6065
|
},
|
|
6052
6066
|
/**
|
|
@@ -6055,8 +6069,8 @@ n
|
|
|
6055
6069
|
*/
|
|
6056
6070
|
t.prototype.st = function(t) {
|
|
6057
6071
|
var e = this, n = new Map;
|
|
6058
|
-
this.
|
|
6059
|
-
var o = e.
|
|
6072
|
+
this.Qe.forEach((function(r, i) {
|
|
6073
|
+
var o = e.Xe(i);
|
|
6060
6074
|
if (o) {
|
|
6061
6075
|
if (r.current && zn(o.target)) {
|
|
6062
6076
|
// Document queries for document that don't exist can produce an empty
|
|
@@ -6068,9 +6082,9 @@ n
|
|
|
6068
6082
|
// instead resulting in an explicit delete message and we could
|
|
6069
6083
|
// remove this special logic.
|
|
6070
6084
|
var a = new pt(o.target.path);
|
|
6071
|
-
null !== e
|
|
6085
|
+
null !== e.Ke.get(a) || e.ot(i, a) || e.ze(i, a, dn.newNoDocument(a, t));
|
|
6072
6086
|
}
|
|
6073
|
-
r.
|
|
6087
|
+
r.Ce && (n.set(i, r.Me()), r.xe());
|
|
6074
6088
|
}
|
|
6075
6089
|
}));
|
|
6076
6090
|
var r = Ir();
|
|
@@ -6078,28 +6092,28 @@ n
|
|
|
6078
6092
|
// special-cases documents that do not appear in the target cache.
|
|
6079
6093
|
// TODO(gsoltis): Expand on this comment once GC is available in the JS
|
|
6080
6094
|
// client.
|
|
6081
|
-
this.
|
|
6095
|
+
this.$e.forEach((function(t, n) {
|
|
6082
6096
|
var i = !0;
|
|
6083
6097
|
n.forEachWhile((function(t) {
|
|
6084
|
-
var n = e.
|
|
6098
|
+
var n = e.Xe(t);
|
|
6085
6099
|
return !n || "TargetPurposeLimboResolution" /* TargetPurpose.LimboResolution */ === n.purpose || (i = !1,
|
|
6086
6100
|
!1);
|
|
6087
6101
|
})), i && (r = r.add(t));
|
|
6088
|
-
})), this
|
|
6102
|
+
})), this.Ke.forEach((function(e, n) {
|
|
6089
6103
|
return n.setReadTime(t);
|
|
6090
6104
|
}));
|
|
6091
|
-
var i = new wi(t, n, this.
|
|
6092
|
-
return this
|
|
6105
|
+
var i = new wi(t, n, this.Ue, this.Ke, r);
|
|
6106
|
+
return this.Ke = fr(), this.$e = Di(), this.Ue = new Te(ot), i;
|
|
6093
6107
|
},
|
|
6094
6108
|
/**
|
|
6095
6109
|
* Adds the provided document to the internal list of document updates and
|
|
6096
6110
|
* its document key to the given target's mapping.
|
|
6097
6111
|
*/
|
|
6098
6112
|
// Visible for testing.
|
|
6099
|
-
t.prototype.
|
|
6100
|
-
if (this.
|
|
6113
|
+
t.prototype.Ge = function(t, e) {
|
|
6114
|
+
if (this.Je(t)) {
|
|
6101
6115
|
var n = this.ot(t, e.key) ? 2 /* ChangeType.Modified */ : 0 /* ChangeType.Added */;
|
|
6102
|
-
this.
|
|
6116
|
+
this.He(t).Oe(e.key, n), this.Ke = this.Ke.insert(e.key, e), this.$e = this.$e.insert(e.key, this._t(e.key).add(t));
|
|
6103
6117
|
}
|
|
6104
6118
|
},
|
|
6105
6119
|
/**
|
|
@@ -6110,65 +6124,65 @@ n
|
|
|
6110
6124
|
* to update the remote document cache.
|
|
6111
6125
|
*/
|
|
6112
6126
|
// Visible for testing.
|
|
6113
|
-
t.prototype.
|
|
6114
|
-
if (this.
|
|
6115
|
-
var r = this.
|
|
6116
|
-
this.ot(t, e) ? r.
|
|
6127
|
+
t.prototype.ze = function(t, e, n) {
|
|
6128
|
+
if (this.Je(t)) {
|
|
6129
|
+
var r = this.He(t);
|
|
6130
|
+
this.ot(t, e) ? r.Oe(e, 1 /* ChangeType.Removed */) :
|
|
6117
6131
|
// The document may have entered and left the target before we raised a
|
|
6118
6132
|
// snapshot, so we can just ignore the change.
|
|
6119
|
-
r.
|
|
6133
|
+
r.Ne(e), this.$e = this.$e.insert(e, this._t(e).delete(t)), n && (this.Ke = this.Ke.insert(e, n));
|
|
6120
6134
|
}
|
|
6121
6135
|
}, t.prototype.removeTarget = function(t) {
|
|
6122
|
-
this.
|
|
6136
|
+
this.Qe.delete(t);
|
|
6123
6137
|
},
|
|
6124
6138
|
/**
|
|
6125
6139
|
* Returns the current count of documents in the target. This includes both
|
|
6126
6140
|
* the number of documents that the LocalStore considers to be part of the
|
|
6127
6141
|
* target as well as any accumulated changes.
|
|
6128
6142
|
*/
|
|
6129
|
-
t.prototype.
|
|
6130
|
-
var e = this.
|
|
6131
|
-
return this.
|
|
6143
|
+
t.prototype.et = function(t) {
|
|
6144
|
+
var e = this.He(t).Me();
|
|
6145
|
+
return this.qe.getRemoteKeysForTarget(t).size + e.addedDocuments.size - e.removedDocuments.size;
|
|
6132
6146
|
},
|
|
6133
6147
|
/**
|
|
6134
6148
|
* Increment the number of acks needed from watch before we can consider the
|
|
6135
6149
|
* server to be 'in-sync' with the client's active targets.
|
|
6136
6150
|
*/
|
|
6137
|
-
t.prototype.
|
|
6138
|
-
this.
|
|
6139
|
-
}, t.prototype.
|
|
6140
|
-
var e = this.
|
|
6141
|
-
return e || (e = new Ei, this.
|
|
6151
|
+
t.prototype.Be = function(t) {
|
|
6152
|
+
this.He(t).Be();
|
|
6153
|
+
}, t.prototype.He = function(t) {
|
|
6154
|
+
var e = this.Qe.get(t);
|
|
6155
|
+
return e || (e = new Ei, this.Qe.set(t, e)), e;
|
|
6142
6156
|
}, t.prototype._t = function(t) {
|
|
6143
|
-
var e = this.
|
|
6144
|
-
return e || (e = new De(ot), this
|
|
6157
|
+
var e = this.$e.get(t);
|
|
6158
|
+
return e || (e = new De(ot), this.$e = this.$e.insert(t, e)), e;
|
|
6145
6159
|
},
|
|
6146
6160
|
/**
|
|
6147
6161
|
* Verifies that the user is still interested in this target (by calling
|
|
6148
6162
|
* `getTargetDataForTarget()`) and that we are not waiting for pending ADDs
|
|
6149
6163
|
* from watch.
|
|
6150
6164
|
*/
|
|
6151
|
-
t.prototype.
|
|
6152
|
-
var e = null !== this.
|
|
6165
|
+
t.prototype.Je = function(t) {
|
|
6166
|
+
var e = null !== this.Xe(t);
|
|
6153
6167
|
return e || L("WatchChangeAggregator", "Detected inactive target", t), e;
|
|
6154
6168
|
},
|
|
6155
6169
|
/**
|
|
6156
6170
|
* Returns the TargetData for an active target (i.e. a target that the user
|
|
6157
6171
|
* is still interested in that has no outstanding target change requests).
|
|
6158
6172
|
*/
|
|
6159
|
-
t.prototype.
|
|
6160
|
-
var e = this.
|
|
6161
|
-
return e && e.
|
|
6173
|
+
t.prototype.Xe = function(t) {
|
|
6174
|
+
var e = this.Qe.get(t);
|
|
6175
|
+
return e && e.ve ? null : this.qe.ut(t);
|
|
6162
6176
|
},
|
|
6163
6177
|
/**
|
|
6164
6178
|
* Resets the state of a Watch target to its initial state (e.g. sets
|
|
6165
6179
|
* 'current' to false, clears the resume token and removes its target mapping
|
|
6166
6180
|
* from all documents).
|
|
6167
6181
|
*/
|
|
6168
|
-
t.prototype.
|
|
6182
|
+
t.prototype.Ye = function(t) {
|
|
6169
6183
|
var e = this;
|
|
6170
|
-
this.
|
|
6171
|
-
e.
|
|
6184
|
+
this.Qe.set(t, new Ei), this.qe.getRemoteKeysForTarget(t).forEach((function(n) {
|
|
6185
|
+
e.ze(t, n, /*updatedDocument=*/ null);
|
|
6172
6186
|
}));
|
|
6173
6187
|
},
|
|
6174
6188
|
/**
|
|
@@ -6176,7 +6190,7 @@ n
|
|
|
6176
6190
|
* specified target.
|
|
6177
6191
|
*/
|
|
6178
6192
|
t.prototype.ot = function(t, e) {
|
|
6179
|
-
return this.
|
|
6193
|
+
return this.qe.getRemoteKeysForTarget(t).has(e);
|
|
6180
6194
|
}, t;
|
|
6181
6195
|
}();
|
|
6182
6196
|
|
|
@@ -14132,7 +14146,7 @@ r, i, o, a) {
|
|
|
14132
14146
|
* We need to increment the the expected number of pending responses we're due
|
|
14133
14147
|
* from watch so we wait for the ack to process any messages from this target.
|
|
14134
14148
|
*/ function Hu(t, e) {
|
|
14135
|
-
if (t.b_.
|
|
14149
|
+
if (t.b_.Be(e.targetId), e.resumeToken.approximateByteSize() > 0 || e.snapshotVersion.compareTo(ct.min()) > 0) {
|
|
14136
14150
|
var n = t.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;
|
|
14137
14151
|
e = e.withExpectedCount(n);
|
|
14138
14152
|
}
|
|
@@ -14144,7 +14158,7 @@ r, i, o, a) {
|
|
|
14144
14158
|
* from watch so we wait for the removal on the server before we process any
|
|
14145
14159
|
* messages from this target.
|
|
14146
14160
|
*/ function Yu(t, e) {
|
|
14147
|
-
t.b_.
|
|
14161
|
+
t.b_.Be(e), ps(t).i_(e);
|
|
14148
14162
|
}
|
|
14149
14163
|
|
|
14150
14164
|
function Ju(t) {
|
|
@@ -14155,7 +14169,7 @@ function Ju(t) {
|
|
|
14155
14169
|
ut: function(e) {
|
|
14156
14170
|
return t.g_.get(e) || null;
|
|
14157
14171
|
},
|
|
14158
|
-
|
|
14172
|
+
rt: function() {
|
|
14159
14173
|
return t.datastore.serializer.databaseId;
|
|
14160
14174
|
}
|
|
14161
14175
|
}), ps(t).start(), t.S_.d_()
|
|
@@ -14256,7 +14270,7 @@ function ns(t, r, i) {
|
|
|
14256
14270
|
return [ 3 /*break*/ , 13 ];
|
|
14257
14271
|
|
|
14258
14272
|
case 6:
|
|
14259
|
-
if (r instanceof Ii ? t.b_.
|
|
14273
|
+
if (r instanceof Ii ? t.b_.We(r) : r instanceof _i ? t.b_.Ze(r) : t.b_.je(r), i.isEqual(ct.min())) return [ 3 /*break*/ , 13 ];
|
|
14260
14274
|
s.label = 7;
|
|
14261
14275
|
|
|
14262
14276
|
case 7:
|
|
@@ -22197,9 +22211,9 @@ function qf(t, e) {
|
|
|
22197
22211
|
return r = Object.assign({
|
|
22198
22212
|
useFetchStreams: Nf
|
|
22199
22213
|
}, r), o._setSettings(r), o;
|
|
22200
|
-
}), "PUBLIC").setMultipleInstances(!0)), a(k, "3.13.0-canary.
|
|
22214
|
+
}), "PUBLIC").setMultipleInstances(!0)), a(k, "3.13.0-canary.f3067f72d", xf),
|
|
22201
22215
|
// BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
|
|
22202
|
-
a(k, "3.13.0-canary.
|
|
22216
|
+
a(k, "3.13.0-canary.f3067f72d", "esm5");
|
|
22203
22217
|
|
|
22204
22218
|
export { Mh as AbstractUserDataWriter, Cl as AggregateField, xl as AggregateQuerySnapshot, Nl as Bytes, ll as CACHE_SIZE_UNLIMITED, el as CollectionReference, tl as DocumentReference, Kh as DocumentSnapshot, Al as FieldPath, Pl as FieldValue, hl as Firestore, Q as FirestoreError, Ol as GeoPoint, cl as LoadBundleTask, $c as Query, vh as QueryCompositeFilterConstraint, hh as QueryConstraint, jh as QueryDocumentSnapshot, Dh as QueryEndAtConstraint, dh as QueryFieldFilterConstraint, bh as QueryLimitConstraint, gh as QueryOrderByConstraint, Qh as QuerySnapshot, Th as QueryStartAtConstraint, Gh as SnapshotMetadata, st as Timestamp, Af as Transaction, Df as WriteBatch, Be as _DatabaseId, pt as _DocumentKey, nt as _EmptyAppCheckTokenProvider, Y as _EmptyAuthCredentialsProvider, dt as _FieldPath, hi as _TestingHooks, Hc as _cast, G as _debugAssert, ke as _isBase64Available, q as _logWarn, Kc as _validateIsNotUsedTogether, af as addDoc, Bh as aggregateFieldEqual, zh as aggregateQuerySnapshotEqual, yh as and, Mf as arrayRemove, Rf as arrayUnion, qh as average, wl as clearIndexedDbPersistence, nl as collection, rl as collectionGroup, Zc as connectFirestoreEmulator, Uh as count, of as deleteDoc, Pf as deleteField, _l as disableNetwork, il as doc, kl as documentId, ml as enableIndexedDbPersistence, yl as enableMultiTabIndexedDbPersistence, Il as enableNetwork, xh as endAt, Ch as endBefore, pl as ensureFirestoreConfigured, cf as executeWrite, ff as getAggregateFromServer, hf as getCountFromServer, Yh as getDoc, Xh as getDocFromCache, Zh as getDocFromServer, $h as getDocs, tf as getDocsFromCache, ef as getDocsFromServer, dl as getFirestore, Ff as increment, fl as initializeFirestore, Ih as limit, _h as limitToLast, El as loadBundle, yf as memoryEagerGarbageCollector, wf as memoryLocalCache, gf as memoryLruGarbageCollector, Sl as namedQuery, uf as onSnapshot, sf as onSnapshotsInSync, mh as or, wh as orderBy, bf as persistentLocalCache, Ef as persistentMultipleTabManager, Tf as persistentSingleTabManager, fh as query, al as queryEqual, ol as refEqual, kf as runTransaction, Of as serverTimestamp, nf as setDoc, Vf as setIndexConfiguration, F as setLogLevel, Hh as snapshotEqual, Sh as startAfter, Eh as startAt, Vh as sum, Tl as terminate, rf as updateDoc, bl as waitForPendingWrites, ph as where, Lf as writeBatch };
|
|
22205
22219
|
//# sourceMappingURL=index.esm5.js.map
|