@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
@@ -9,7 +9,7 @@ import * as grpc from '@grpc/grpc-js';
9
9
  import * as protoLoader from '@grpc/proto-loader';
10
10
 
11
11
  const name = "@firebase/firestore";
12
- const version$1 = "4.5.0-canary.9ca1a4e4f";
12
+ const version$1 = "4.5.0-canary.c6ecac8ac";
13
13
 
14
14
  /**
15
15
  * @license
@@ -62,7 +62,7 @@ User.GOOGLE_CREDENTIALS = new User('google-credentials-uid');
62
62
  User.FIRST_PARTY = new User('first-party-uid');
63
63
  User.MOCK_USER = new User('mock-user');
64
64
 
65
- const version = "10.9.0-canary.9ca1a4e4f";
65
+ const version = "10.9.0-canary.c6ecac8ac";
66
66
 
67
67
  /**
68
68
  * @license
@@ -3155,9 +3155,13 @@ const V15_STORES = [
3155
3155
  DbIndexStateStore,
3156
3156
  DbIndexEntryStore
3157
3157
  ];
3158
+ const V16_STORES = V15_STORES;
3158
3159
  /** Returns the object stores for the provided schema. */
3159
3160
  function getObjectStores(schemaVersion) {
3160
- if (schemaVersion === 15) {
3161
+ if (schemaVersion === 16) {
3162
+ return V16_STORES;
3163
+ }
3164
+ else if (schemaVersion === 15) {
3161
3165
  return V15_STORES;
3162
3166
  }
3163
3167
  else if (schemaVersion === 14) {
@@ -10425,15 +10429,13 @@ class FirestoreIndexValueWriter {
10425
10429
  }
10426
10430
  }
10427
10431
  else if ('timestampValue' in indexValue) {
10428
- const timestamp = indexValue.timestampValue;
10432
+ let timestamp = indexValue.timestampValue;
10429
10433
  this.writeValueTypeLabel(encoder, INDEX_TYPE_TIMESTAMP);
10430
10434
  if (typeof timestamp === 'string') {
10431
- encoder.writeString(timestamp);
10432
- }
10433
- else {
10434
- encoder.writeString(`${timestamp.seconds || ''}`);
10435
- encoder.writeNumber(timestamp.nanos || 0);
10435
+ timestamp = normalizeTimestamp(timestamp);
10436
10436
  }
10437
+ encoder.writeString(`${timestamp.seconds || ''}`);
10438
+ encoder.writeNumber(timestamp.nanos || 0);
10437
10439
  }
10438
10440
  else if ('stringValue' in indexValue) {
10439
10441
  this.writeIndexString(indexValue.stringValue, encoder);
@@ -13922,8 +13924,9 @@ function dbKeyComparator(l, r) {
13922
13924
  * document lookup via `getAll()`.
13923
13925
  * 14. Add overlays.
13924
13926
  * 15. Add indexing support.
13927
+ * 16. Parse timestamp strings before creating index entries.
13925
13928
  */
13926
- const SCHEMA_VERSION = 15;
13929
+ const SCHEMA_VERSION = 16;
13927
13930
 
13928
13931
  /**
13929
13932
  * @license
@@ -15522,6 +15525,18 @@ class SchemaConverter {
15522
15525
  if (fromVersion < 15 && toVersion >= 15) {
15523
15526
  p = p.next(() => createFieldIndex(db));
15524
15527
  }
15528
+ if (fromVersion < 16 && toVersion >= 16) {
15529
+ // Clear the object stores to remove possibly corrupted index entries
15530
+ p = p
15531
+ .next(() => {
15532
+ const indexStateStore = txn.objectStore(DbIndexStateStore);
15533
+ indexStateStore.clear();
15534
+ })
15535
+ .next(() => {
15536
+ const indexEntryStore = txn.objectStore(DbIndexEntryStore);
15537
+ indexEntryStore.clear();
15538
+ });
15539
+ }
15525
15540
  return p;
15526
15541
  }
15527
15542
  addDocumentGlobal(txn) {