Skip to content

Commit 76e3c6f

Browse files
Renames
1 parent ddddda8 commit 76e3c6f

File tree

6 files changed

+34
-27
lines changed

6 files changed

+34
-27
lines changed

packages/firestore/exp/src/api/database.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ import { LruParams } from '../../../src/local/lru_garbage_collector';
4747
import { CACHE_SIZE_UNLIMITED } from '../../../src/api/database';
4848
import { DatabaseId, DatabaseInfo } from '../../../src/core/database_info';
4949
import {
50-
buildStoragePrefix,
51-
clearPersistence
50+
indexedDbStoragePrefix,
51+
indexedDbClearPersistence
5252
} from '../../../src/local/indexeddb_persistence';
5353

5454
/**
@@ -255,7 +255,9 @@ export function clearIndexedDbPersistence(
255255
): Promise<void> {
256256
const firestoreImpl = cast(firestore, Firestore);
257257
return firestoreImpl._clearPersistence((databaseId, persistenceKey) => {
258-
return clearPersistence(buildStoragePrefix(databaseId, persistenceKey));
258+
return indexedDbClearPersistence(
259+
indexedDbStoragePrefix(databaseId, persistenceKey)
260+
);
259261
});
260262
}
261263

packages/firestore/exp/test/deps/dependencies.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6042,7 +6042,6 @@
60426042
"binaryStringFromUint8Array",
60436043
"blobEquals",
60446044
"boundEquals",
6045-
"buildStoragePrefix",
60466045
"canonicalId",
60476046
"canonifyArray",
60486047
"canonifyBound",
@@ -6059,7 +6058,6 @@
60596058
"cast",
60606059
"checkForAndReportiOSError",
60616060
"clearIndexedDbPersistence",
6062-
"clearPersistence",
60636061
"coercedFieldValuesArray",
60646062
"compareArrays",
60656063
"compareBlobs",
@@ -6114,6 +6112,8 @@
61146112
"getWindow",
61156113
"hardAssert",
61166114
"ignoreIfPrimaryLeaseLoss",
6115+
"indexedDbClearPersistence",
6116+
"indexedDbStoragePrefix",
61176117
"invokeBatchGetDocumentsRpc",
61186118
"invokeCommitRpc",
61196119
"isArray",
@@ -6352,7 +6352,7 @@
63526352
],
63536353
"variables": []
63546354
},
6355-
"sizeInBytes": 238375
6355+
"sizeInBytes": 238401
63566356
},
63576357
"collection": {
63586358
"dependencies": {
@@ -8842,7 +8842,6 @@
88428842
"blobEquals",
88438843
"boundEquals",
88448844
"bufferEntryComparator",
8845-
"buildStoragePrefix",
88468845
"canonicalId",
88478846
"canonifyArray",
88488847
"canonifyBound",
@@ -8858,7 +8857,6 @@
88588857
"canonifyValue",
88598858
"cast",
88608859
"checkForAndReportiOSError",
8861-
"clearPersistence",
88628860
"clientMetadataStore",
88638861
"coercedFieldValuesArray",
88648862
"collectionParentsStore",
@@ -8960,6 +8958,8 @@
89608958
"hardAssert",
89618959
"ignoreIfPrimaryLeaseLoss",
89628960
"immediateSuccessor",
8961+
"indexedDbClearPersistence",
8962+
"indexedDbStoragePrefix",
89638963
"invokeBatchGetDocumentsRpc",
89648964
"invokeCommitRpc",
89658965
"isArray",
@@ -9247,7 +9247,7 @@
92479247
],
92489248
"variables": []
92499249
},
9250-
"sizeInBytes": 312097
9250+
"sizeInBytes": 312127
92519251
},
92529252
"enableMultiTabIndexedDbPersistence": {
92539253
"dependencies": {
@@ -9276,7 +9276,6 @@
92769276
"blobEquals",
92779277
"boundEquals",
92789278
"bufferEntryComparator",
9279-
"buildStoragePrefix",
92809279
"canonicalId",
92819280
"canonifyArray",
92829281
"canonifyBound",
@@ -9292,7 +9291,6 @@
92929291
"canonifyValue",
92939292
"cast",
92949293
"checkForAndReportiOSError",
9295-
"clearPersistence",
92969294
"clientMetadataStore",
92979295
"coercedFieldValuesArray",
92989296
"collectionParentsStore",
@@ -9400,6 +9398,8 @@
94009398
"hardAssert",
94019399
"ignoreIfPrimaryLeaseLoss",
94029400
"immediateSuccessor",
9401+
"indexedDbClearPersistence",
9402+
"indexedDbStoragePrefix",
94039403
"invokeBatchGetDocumentsRpc",
94049404
"invokeCommitRpc",
94059405
"isArray",
@@ -9698,7 +9698,7 @@
96989698
],
96999699
"variables": []
97009700
},
9701-
"sizeInBytes": 336485
9701+
"sizeInBytes": 336519
97029702
},
97039703
"enableNetwork": {
97049704
"dependencies": {

packages/firestore/src/core/component_provider.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ import { OnlineStateSource } from './types';
4747
import { LruParams, LruScheduler } from '../local/lru_garbage_collector';
4848
import { IndexFreeQueryEngine } from '../local/index_free_query_engine';
4949
import {
50-
buildStoragePrefix,
50+
indexedDbStoragePrefix,
5151
IndexedDbPersistence,
52-
clearPersistence
52+
indexedDbClearPersistence
5353
} from '../local/indexeddb_persistence';
5454
import {
5555
MemoryEagerDelegate,
@@ -239,7 +239,7 @@ export class IndexedDbComponentProvider extends MemoryComponentProvider {
239239
'Can only start durable persistence'
240240
);
241241

242-
const persistenceKey = buildStoragePrefix(
242+
const persistenceKey = indexedDbStoragePrefix(
243243
cfg.databaseInfo.databaseId,
244244
cfg.databaseInfo.persistenceKey
245245
);
@@ -266,7 +266,9 @@ export class IndexedDbComponentProvider extends MemoryComponentProvider {
266266
databaseId: DatabaseId,
267267
persistenceKey: string
268268
): Promise<void> {
269-
return clearPersistence(buildStoragePrefix(databaseId, persistenceKey));
269+
return indexedDbClearPersistence(
270+
indexedDbStoragePrefix(databaseId, persistenceKey)
271+
);
270272
}
271273
}
272274

@@ -336,7 +338,7 @@ export class MultiTabIndexedDbComponentProvider extends IndexedDbComponentProvid
336338
'IndexedDB persistence is only available on platforms that support LocalStorage.'
337339
);
338340
}
339-
const persistenceKey = buildStoragePrefix(
341+
const persistenceKey = indexedDbStoragePrefix(
340342
cfg.databaseInfo.databaseId,
341343
cfg.databaseInfo.persistenceKey
342344
);

packages/firestore/src/local/indexeddb_persistence.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,7 @@ function writeSentinelKey(
13121312
* Generates a string used as a prefix when storing data in IndexedDB and
13131313
* LocalStorage.
13141314
*/
1315-
export function buildStoragePrefix(
1315+
export function indexedDbStoragePrefix(
13161316
databaseId: DatabaseId,
13171317
persistenceKey: string
13181318
): string {
@@ -1331,7 +1331,9 @@ export function buildStoragePrefix(
13311331
return 'firestore/' + persistenceKey + '/' + database + '/';
13321332
}
13331333

1334-
export async function clearPersistence(persistenceKey: string): Promise<void> {
1334+
export async function indexedDbClearPersistence(
1335+
persistenceKey: string
1336+
): Promise<void> {
13351337
if (!SimpleDb.isAvailable()) {
13361338
return Promise.resolve();
13371339
}

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ import {
2727
} from '../../../src/core/types';
2828

2929
import {
30-
buildStoragePrefix,
31-
clearPersistence,
30+
indexedDbStoragePrefix,
31+
indexedDbClearPersistence,
3232
IndexedDbPersistence,
3333
MAIN_DATABASE
3434
} from '../../../src/local/indexeddb_persistence';
@@ -67,7 +67,7 @@ export const TEST_DATABASE_ID = new DatabaseId('test-project');
6767
export const TEST_PERSISTENCE_KEY = '[PersistenceTestHelpers]';
6868

6969
/** The persistence prefix used for testing in IndexedBD and LocalStorage. */
70-
export const TEST_PERSISTENCE_PREFIX = buildStoragePrefix(
70+
export const TEST_PERSISTENCE_PREFIX = indexedDbStoragePrefix(
7171
TEST_DATABASE_ID,
7272
TEST_PERSISTENCE_KEY
7373
);
@@ -78,7 +78,8 @@ export const TEST_PERSISTENCE_PREFIX = buildStoragePrefix(
7878
* `TEST_DATABASE_ID`.
7979
*/
8080
export const INDEXEDDB_TEST_DATABASE_NAME =
81-
buildStoragePrefix(TEST_DATABASE_ID, TEST_PERSISTENCE_KEY) + MAIN_DATABASE;
81+
indexedDbStoragePrefix(TEST_DATABASE_ID, TEST_PERSISTENCE_KEY) +
82+
MAIN_DATABASE;
8283

8384
const JSON_SERIALIZER = new JsonProtoSerializer(
8485
TEST_DATABASE_ID,
@@ -138,7 +139,7 @@ export async function testMemoryLruPersistence(
138139

139140
/** Clears the persistence in tests */
140141
export function clearTestPersistence(): Promise<void> {
141-
return clearPersistence(TEST_PERSISTENCE_PREFIX);
142+
return indexedDbClearPersistence(TEST_PERSISTENCE_PREFIX);
142143
}
143144

144145
class NoOpSharedClientStateSyncer implements SharedClientStateSyncer {

packages/firestore/test/unit/specs/spec_test_components.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
PersistenceTransactionMode
2828
} from '../../../src/local/persistence';
2929
import {
30-
buildStoragePrefix,
30+
indexedDbStoragePrefix,
3131
IndexedDbPersistence
3232
} from '../../../src/local/indexeddb_persistence';
3333
import { PersistencePromise } from '../../../src/local/persistence_promise';
@@ -134,7 +134,7 @@ export class MockIndexedDbComponentProvider extends MultiTabIndexedDbComponentPr
134134
}
135135

136136
createSharedClientState(cfg: ComponentConfiguration): SharedClientState {
137-
const persistenceKey = buildStoragePrefix(
137+
const persistenceKey = indexedDbStoragePrefix(
138138
cfg.databaseInfo.databaseId,
139139
cfg.databaseInfo.persistenceKey
140140
);
@@ -153,7 +153,7 @@ export class MockIndexedDbComponentProvider extends MultiTabIndexedDbComponentPr
153153
'Can only start durable persistence'
154154
);
155155

156-
const persistenceKey = buildStoragePrefix(
156+
const persistenceKey = indexedDbStoragePrefix(
157157
cfg.databaseInfo.databaseId,
158158
cfg.databaseInfo.persistenceKey
159159
);

0 commit comments

Comments
 (0)