@firebase/firestore 4.5.0-canary.9ca1a4e4f → 4.5.0-canary.c6ecac8ac

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.
Files changed (36) hide show
  1. package/dist/firestore/src/local/indexeddb_schema.d.ts +2 -1
  2. package/dist/firestore/src/local/indexeddb_sentinels.d.ts +1 -0
  3. package/dist/firestore/test/unit/index/firestore_index_value_writer.test.d.ts +1 -0
  4. package/dist/firestore/test/unit/index/ordered_code_writer.test.d.ts +1 -1
  5. package/dist/index.cjs.js +134 -126
  6. package/dist/index.cjs.js.map +1 -1
  7. package/dist/index.esm2017.js +134 -126
  8. package/dist/index.esm2017.js.map +1 -1
  9. package/dist/index.esm5.js +2164 -2157
  10. package/dist/index.esm5.js.map +1 -1
  11. package/dist/index.node.cjs.js +25 -10
  12. package/dist/index.node.cjs.js.map +1 -1
  13. package/dist/index.node.mjs +25 -10
  14. package/dist/index.node.mjs.map +1 -1
  15. package/dist/index.rn.js +134 -126
  16. package/dist/index.rn.js.map +1 -1
  17. package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +2 -1
  18. package/dist/lite/firestore/src/local/indexeddb_sentinels.d.ts +1 -0
  19. package/dist/lite/firestore/test/unit/index/firestore_index_value_writer.test.d.ts +1 -0
  20. package/dist/lite/firestore/test/unit/index/ordered_code_writer.test.d.ts +1 -1
  21. package/dist/lite/index.browser.esm2017.js +2 -2
  22. package/dist/lite/index.browser.esm5.js +2 -2
  23. package/dist/lite/index.cjs.js +2 -2
  24. package/dist/lite/index.node.cjs.js +2 -2
  25. package/dist/lite/index.node.mjs +2 -2
  26. package/dist/lite/index.rn.esm2017.js +2 -2
  27. package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +2 -1
  28. package/dist/lite/packages/firestore/src/local/indexeddb_sentinels.d.ts +1 -0
  29. package/dist/lite/packages/firestore/test/unit/index/firestore_index_value_writer.test.d.ts +1 -0
  30. package/dist/lite/packages/firestore/test/unit/index/ordered_code_writer.test.d.ts +1 -1
  31. package/dist/packages/firestore/dist/index.esm2017.d.ts +2 -2
  32. package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +2 -1
  33. package/dist/packages/firestore/src/local/indexeddb_sentinels.d.ts +1 -0
  34. package/dist/packages/firestore/test/unit/index/firestore_index_value_writer.test.d.ts +1 -0
  35. package/dist/packages/firestore/test/unit/index/ordered_code_writer.test.d.ts +1 -1
  36. package/package.json +9 -9
@@ -34,7 +34,7 @@ var grpc__namespace = /*#__PURE__*/_interopNamespace(grpc);
34
34
  var protoLoader__namespace = /*#__PURE__*/_interopNamespace(protoLoader);
35
35
 
36
36
  const name = "@firebase/firestore";
37
- const version$1 = "4.5.0-canary.9ca1a4e4f";
37
+ const version$1 = "4.5.0-canary.c6ecac8ac";
38
38
 
39
39
  /**
40
40
  * @license
@@ -87,7 +87,7 @@ User.GOOGLE_CREDENTIALS = new User('google-credentials-uid');
87
87
  User.FIRST_PARTY = new User('first-party-uid');
88
88
  User.MOCK_USER = new User('mock-user');
89
89
 
90
- const version = "10.9.0-canary.9ca1a4e4f";
90
+ const version = "10.9.0-canary.c6ecac8ac";
91
91
 
92
92
  /**
93
93
  * @license
@@ -3180,9 +3180,13 @@ const V15_STORES = [
3180
3180
  DbIndexStateStore,
3181
3181
  DbIndexEntryStore
3182
3182
  ];
3183
+ const V16_STORES = V15_STORES;
3183
3184
  /** Returns the object stores for the provided schema. */
3184
3185
  function getObjectStores(schemaVersion) {
3185
- if (schemaVersion === 15) {
3186
+ if (schemaVersion === 16) {
3187
+ return V16_STORES;
3188
+ }
3189
+ else if (schemaVersion === 15) {
3186
3190
  return V15_STORES;
3187
3191
  }
3188
3192
  else if (schemaVersion === 14) {
@@ -10450,15 +10454,13 @@ class FirestoreIndexValueWriter {
10450
10454
  }
10451
10455
  }
10452
10456
  else if ('timestampValue' in indexValue) {
10453
- const timestamp = indexValue.timestampValue;
10457
+ let timestamp = indexValue.timestampValue;
10454
10458
  this.writeValueTypeLabel(encoder, INDEX_TYPE_TIMESTAMP);
10455
10459
  if (typeof timestamp === 'string') {
10456
- encoder.writeString(timestamp);
10457
- }
10458
- else {
10459
- encoder.writeString(`${timestamp.seconds || ''}`);
10460
- encoder.writeNumber(timestamp.nanos || 0);
10460
+ timestamp = normalizeTimestamp(timestamp);
10461
10461
  }
10462
+ encoder.writeString(`${timestamp.seconds || ''}`);
10463
+ encoder.writeNumber(timestamp.nanos || 0);
10462
10464
  }
10463
10465
  else if ('stringValue' in indexValue) {
10464
10466
  this.writeIndexString(indexValue.stringValue, encoder);
@@ -13947,8 +13949,9 @@ function dbKeyComparator(l, r) {
13947
13949
  * document lookup via `getAll()`.
13948
13950
  * 14. Add overlays.
13949
13951
  * 15. Add indexing support.
13952
+ * 16. Parse timestamp strings before creating index entries.
13950
13953
  */
13951
- const SCHEMA_VERSION = 15;
13954
+ const SCHEMA_VERSION = 16;
13952
13955
 
13953
13956
  /**
13954
13957
  * @license
@@ -15547,6 +15550,18 @@ class SchemaConverter {
15547
15550
  if (fromVersion < 15 && toVersion >= 15) {
15548
15551
  p = p.next(() => createFieldIndex(db));
15549
15552
  }
15553
+ if (fromVersion < 16 && toVersion >= 16) {
15554
+ // Clear the object stores to remove possibly corrupted index entries
15555
+ p = p
15556
+ .next(() => {
15557
+ const indexStateStore = txn.objectStore(DbIndexStateStore);
15558
+ indexStateStore.clear();
15559
+ })
15560
+ .next(() => {
15561
+ const indexEntryStore = txn.objectStore(DbIndexEntryStore);
15562
+ indexEntryStore.clear();
15563
+ });
15564
+ }
15550
15565
  return p;
15551
15566
  }
15552
15567
  addDocumentGlobal(txn) {