@firebase/firestore 3.4.1-canary.be7ccb8ed → 3.4.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @firebase/firestore
2
2
 
3
+ ## 3.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`3b481f572`](https://github.com/firebase/firebase-js-sdk/commit/3b481f572456e1eab3435bfc25717770d95a8c49) [#5831](https://github.com/firebase/firebase-js-sdk/pull/5831) (fixes [#5754](https://github.com/firebase/firebase-js-sdk/issues/5754)) - FirestoreError and StorageError now extend FirebaseError
8
+
9
+ * [`7f05d22e8`](https://github.com/firebase/firebase-js-sdk/commit/7f05d22e827f1fd0732ad33fda203a20566d3964) [#5835](https://github.com/firebase/firebase-js-sdk/pull/5835) - Fixed an issue that can cause incomplete Query snapshots when the SDK is backgrounded during query execution.
10
+
11
+ * Updated dependencies [[`3b481f572`](https://github.com/firebase/firebase-js-sdk/commit/3b481f572456e1eab3435bfc25717770d95a8c49)]:
12
+ - @firebase/util@1.4.3
13
+ - @firebase/component@0.5.10
14
+
3
15
  ## 3.4.1
4
16
 
5
17
  ### Patch Changes
@@ -71,6 +71,7 @@ export declare function bound(values: Array<[string, {}, firestore.OrderByDirect
71
71
  export declare function query(resourcePath: string, ...constraints: Array<OrderBy | Filter>): Query;
72
72
  export declare function targetData(targetId: TargetId, queryPurpose: TargetPurpose, path: string): TargetData;
73
73
  export declare function noChangeEvent(targetId: number, snapshotVersion: number, resumeToken?: ByteString): RemoteEvent;
74
+ export declare function existenceFilterEvent(targetId: number, count: number, snapshotVersion: number): RemoteEvent;
74
75
  export declare function docAddedRemoteEvent(docOrDocs: MutableDocument | MutableDocument[], updatedInTargets?: TargetId[], removedFromTargets?: TargetId[], activeTargets?: TargetId[]): RemoteEvent;
75
76
  export declare function docUpdateRemoteEvent(doc: MutableDocument, updatedInTargets?: TargetId[], removedFromTargets?: TargetId[], limboTargets?: TargetId[]): RemoteEvent;
76
77
  export declare class TestBundledDocuments {
@@ -66,7 +66,7 @@ C.MOCK_USER = new C("mock-user");
66
66
  * See the License for the specific language governing permissions and
67
67
  * limitations under the License.
68
68
  */
69
- let N = "9.6.1-canary.be7ccb8ed";
69
+ let N = "9.6.2";
70
70
 
71
71
  /**
72
72
  * @license
@@ -9016,21 +9016,19 @@ function mr(t) {
9016
9016
  // Reset newTargetDataByTargetMap in case this transaction gets re-run.
9017
9017
  i = n.qn;
9018
9018
  const o = [];
9019
- e.targetChanges.forEach(((e, r) => {
9020
- const a = i.get(r);
9021
- if (!a) return;
9019
+ e.targetChanges.forEach(((r, a) => {
9020
+ const c = i.get(a);
9021
+ if (!c) return;
9022
9022
  // Only update the remote keys if the target is still active. This
9023
9023
  // ensures that we can persist the updated target data along with
9024
9024
  // the updated assignment.
9025
- o.push(n.He.removeMatchingKeys(t, e.removedDocuments, r).next((() => n.He.addMatchingKeys(t, e.addedDocuments, r))));
9026
- const c = e.resumeToken;
9027
- // Update the resume token if the change includes one.
9028
- if (c.approximateByteSize() > 0) {
9029
- const u = a.withResumeToken(c, s).withSequenceNumber(t.currentSequenceNumber);
9030
- i = i.insert(r, u),
9031
- // Update the target data if there are target changes (or if
9032
- // sufficient time has passed since the last update).
9033
- /**
9025
+ o.push(n.He.removeMatchingKeys(t, r.removedDocuments, a).next((() => n.He.addMatchingKeys(t, r.addedDocuments, a))));
9026
+ let u = c.withSequenceNumber(t.currentSequenceNumber);
9027
+ e.targetMismatches.has(a) ? u = u.withResumeToken(pt.EMPTY_BYTE_STRING, ut.min()).withLastLimboFreeSnapshotVersion(ut.min()) : r.resumeToken.approximateByteSize() > 0 && (u = u.withResumeToken(r.resumeToken, s)),
9028
+ i = i.insert(a, u),
9029
+ // Update the target data if there are target changes (or if
9030
+ // sufficient time has passed since the last update).
9031
+ /**
9034
9032
  * Returns true if the newTargetData should be persisted during an update of
9035
9033
  * an active target. TargetData should always be persisted when a target is
9036
9034
  * being released and should not call this function.
@@ -9041,26 +9039,25 @@ function mr(t) {
9041
9039
  * values from getting too stale after a crash, but this doesn't have to be
9042
9040
  * too frequent.
9043
9041
  */
9044
- function(t, e, n) {
9045
- // Always persist target data if we don't already have a resume token.
9046
- if (U(e.resumeToken.approximateByteSize() > 0), 0 === t.resumeToken.approximateByteSize()) return !0;
9047
- // Don't allow resume token changes to be buffered indefinitely. This
9048
- // allows us to be reasonably up-to-date after a crash and avoids needing
9049
- // to loop over all active queries on shutdown. Especially in the browser
9050
- // we may not get time to do anything interesting while the current tab is
9051
- // closing.
9052
- if (e.snapshotVersion.toMicroseconds() - t.snapshotVersion.toMicroseconds() >= 3e8) return !0;
9053
- // Otherwise if the only thing that has changed about a target is its resume
9054
- // token it's not worth persisting. Note that the RemoteStore keeps an
9055
- // in-memory view of the currently active targets which includes the current
9056
- // resume token, so stream failure or user changes will still use an
9057
- // up-to-date resume token regardless of what we do here.
9058
- return n.addedDocuments.size + n.modifiedDocuments.size + n.removedDocuments.size > 0;
9059
- }
9060
- /**
9061
- * Notifies local store of the changed views to locally pin documents.
9062
- */ (a, u, e) && o.push(n.He.updateTargetData(t, u));
9042
+ function(t, e, n) {
9043
+ // Always persist target data if we don't already have a resume token.
9044
+ if (0 === t.resumeToken.approximateByteSize()) return !0;
9045
+ // Don't allow resume token changes to be buffered indefinitely. This
9046
+ // allows us to be reasonably up-to-date after a crash and avoids needing
9047
+ // to loop over all active queries on shutdown. Especially in the browser
9048
+ // we may not get time to do anything interesting while the current tab is
9049
+ // closing.
9050
+ if (e.snapshotVersion.toMicroseconds() - t.snapshotVersion.toMicroseconds() >= 3e8) return !0;
9051
+ // Otherwise if the only thing that has changed about a target is its resume
9052
+ // token it's not worth persisting. Note that the RemoteStore keeps an
9053
+ // in-memory view of the currently active targets which includes the current
9054
+ // resume token, so stream failure or user changes will still use an
9055
+ // up-to-date resume token regardless of what we do here.
9056
+ return n.addedDocuments.size + n.modifiedDocuments.size + n.removedDocuments.size > 0;
9063
9057
  }
9058
+ /**
9059
+ * Notifies local store of the changed views to locally pin documents.
9060
+ */ (c, u, r) && o.push(n.He.updateTargetData(t, u));
9064
9061
  }));
9065
9062
  let a = Rn();
9066
9063
  // HACK: The only reason we allow a null snapshot version is so that we
@@ -17844,9 +17841,9 @@ function Ah(t, e) {
17844
17841
  return n = Object.assign({
17845
17842
  useFetchStreams: e
17846
17843
  }, n), i._setSettings(n), i;
17847
- }), "PUBLIC")), registerVersion(D, "3.4.1-canary.be7ccb8ed", t),
17844
+ }), "PUBLIC")), registerVersion(D, "3.4.2", t),
17848
17845
  // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
17849
- registerVersion(D, "3.4.1-canary.be7ccb8ed", "esm2017");
17846
+ registerVersion(D, "3.4.2", "esm2017");
17850
17847
  }();
17851
17848
 
17852
17849
  export { oh as AbstractUserDataWriter, nu as Bytes, Fc as CACHE_SIZE_UNLIMITED, Vc as CollectionReference, Pc as DocumentReference, $u as DocumentSnapshot, tu as FieldPath, su as FieldValue, Mc as Firestore, Q as FirestoreError, iu as GeoPoint, Oc as LoadBundleTask, vc as Query, Uu as QueryConstraint, Ou as QueryDocumentSnapshot, Fu as QuerySnapshot, xu as SnapshotMetadata, ct as Timestamp, Ph as Transaction, uh as WriteBatch, wc as _DatabaseId, Dt as _DocumentKey, et as _EmptyAppCheckTokenProvider, z as _EmptyAuthCredentialsProvider, mt as _FieldPath, Ec as _cast, q as _debugAssert, yt as _isBase64Available, M as _logWarn, gc as _validateIsNotUsedTogether, Eh as addDoc, Ch as arrayRemove, Dh as arrayUnion, Wc as clearIndexedDbPersistence, Sc as collection, Dc as collectionGroup, bc as connectFirestoreEmulator, Th as deleteDoc, Vh as deleteField, Hc as disableNetwork, Cc as doc, eu as documentId, Kc as enableIndexedDbPersistence, jc as enableMultiTabIndexedDbPersistence, zc as enableNetwork, eh as endAt, th as endBefore, Uc as ensureFirestoreConfigured, Rh as executeWrite, lh as getDoc, dh as getDocFromCache, wh as getDocFromServer, _h as getDocs, mh as getDocsFromCache, gh as getDocsFromServer, Bc as getFirestore, Nh as increment, Lc as initializeFirestore, zu as limit, Hu as limitToLast, Yc as loadBundle, Xc as namedQuery, Ih as onSnapshot, Ah as onSnapshotsInSync, Wu as orderBy, qu as query, kc as queryEqual, Nc as refEqual, vh as runTransaction, Sh as serverTimestamp, yh as setDoc, $ as setLogLevel, Lu as snapshotEqual, Xu as startAfter, Yu as startAt, Jc as terminate, ph as updateDoc, Gc as waitForPendingWrites, ju as where, kh as writeBatch };