Skip to content

Commit e67d030

Browse files
Review comments
1 parent 379404a commit e67d030

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

packages/firestore/src/local/indexeddb_schema.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,10 @@ export function createOrUpgradeDb(
6767
}
6868

6969
if (fromVersion < 3 && toVersion >= 3) {
70-
createClientMetadataStore(db);
71-
createTargetChangeStore(db);
70+
p = p.next(() => {
71+
createClientMetadataStore(db);
72+
createTargetChangeStore(db);
73+
});
7274
}
7375
return p;
7476
}
@@ -645,7 +647,7 @@ export const V1_STORES = [
645647
// Visible for testing
646648
export const V2_STORES = V1_STORES;
647649

648-
const V3_STORES = [...V2_STORES, DbClientMetadata.store, DbTargetChange.store];
650+
export const V3_STORES = [...V2_STORES, DbClientMetadata.store, DbTargetChange.store];
649651

650652
/**
651653
* The list of all default IndexedDB stores used throughout the SDK. This is

packages/firestore/test/unit/local/indexeddb_schema.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
import { expect } from 'chai';
1818
import { IndexedDbPersistence } from '../../../src/local/indexeddb_persistence';
1919
import {
20-
ALL_STORES,
2120
createOrUpgradeDb,
2221
DbTarget,
2322
DbTargetGlobal,
2423
DbTargetGlobalKey,
2524
V1_STORES,
26-
V2_STORES
25+
V2_STORES,
26+
V3_STORES
2727
} from '../../../src/local/indexeddb_schema';
2828
import { SimpleDb, SimpleDbTransaction } from '../../../src/local/simple_db';
2929
import { PersistencePromise } from '../../../src/local/persistence_promise';
@@ -113,7 +113,7 @@ describe('IndexedDbSchema: createOrUpgradeDb', () => {
113113
it('can install schema version 3', () => {
114114
return withDb(3, async db => {
115115
expect(db.version).to.be.equal(3);
116-
expect(getAllObjectStores(db)).to.have.members(ALL_STORES);
116+
expect(getAllObjectStores(db)).to.have.members(V3_STORES);
117117
});
118118
});
119119

@@ -146,7 +146,7 @@ describe('IndexedDbSchema: createOrUpgradeDb', () => {
146146
return withDb(2, async () => {}).then(() =>
147147
withDb(3, async db => {
148148
expect(db.version).to.be.equal(3);
149-
expect(getAllObjectStores(db)).to.have.members(ALL_STORES);
149+
expect(getAllObjectStores(db)).to.have.members(V3_STORES);
150150
})
151151
);
152152
});

0 commit comments

Comments
 (0)