Skip to content

Commit d23d134

Browse files
Michael Lehenbauerschmidt-sebastian
authored andcommitted
Misc. fixes. (#2145)
1 parent aee3d0c commit d23d134

File tree

4 files changed

+12
-19
lines changed

4 files changed

+12
-19
lines changed

packages/firestore/src/local/indexeddb_persistence.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ import { QueryData } from './query_data';
7070
import { ReferenceSet } from './reference_set';
7171
import { ClientId } from './shared_client_state';
7272
import { SimpleDb, SimpleDbStore, SimpleDbTransaction } from './simple_db';
73-
import { SnapshotVersion } from '../core/snapshot_version';
7473

7574
const LOG_TAG = 'IndexedDbPersistence';
7675

packages/firestore/src/local/memory_persistence.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ import { PersistencePromise } from './persistence_promise';
4949
import { QueryData } from './query_data';
5050
import { ReferenceSet } from './reference_set';
5151
import { ClientId } from './shared_client_state';
52-
import { SnapshotVersion } from '../core/snapshot_version';
5352

5453
const LOG_TAG = 'MemoryPersistence';
5554

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,12 @@ function eagerRemoteDocumentCacheTests(
133133
const totalSize = await cache.getSize();
134134
expect(totalSize).to.equal(0);
135135

136-
await cache.removeEntry(doc2.key, version(3));
136+
await cache.removeEntry(doc2.key);
137137

138138
const currentSize = await cache.getSize();
139139
expect(currentSize).to.equal(0);
140140

141-
await cache.removeEntry(doc1.key, version(4));
141+
await cache.removeEntry(doc1.key);
142142

143143
const finalSize = await cache.getSize();
144144
expect(finalSize).to.equal(0);
@@ -171,12 +171,12 @@ function lruRemoteDocumentCacheTests(
171171
const totalSize = await cache.getSize();
172172
expect(totalSize).to.be.greaterThan(doc1Size);
173173

174-
await cache.removeEntry(doc2.key, version(3));
174+
await cache.removeEntry(doc2.key);
175175

176176
const currentSize = await cache.getSize();
177177
expect(currentSize).to.equal(doc1Size);
178178

179-
await cache.removeEntry(doc1.key, version(4));
179+
await cache.removeEntry(doc1.key);
180180

181181
const finalSize = await cache.getSize();
182182
expect(finalSize).to.equal(0);
@@ -282,7 +282,7 @@ function genericRemoteDocumentCacheTests(
282282
return cache
283283
.addEntry(doc(DOC_PATH, VERSION, DOC_DATA))
284284
.then(() => {
285-
return cache.removeEntry(key(DOC_PATH), version(VERSION));
285+
return cache.removeEntry(key(DOC_PATH));
286286
})
287287
.then(() => {
288288
return cache.getEntry(key(DOC_PATH));
@@ -294,7 +294,7 @@ function genericRemoteDocumentCacheTests(
294294

295295
it('can remove nonexistent document', () => {
296296
// no-op, but make sure it doesn't fail.
297-
return cache.removeEntry(key(DOC_PATH), version(1));
297+
return cache.removeEntry(key(DOC_PATH));
298298
});
299299

300300
it('can get documents matching query', async () => {
@@ -360,7 +360,7 @@ function genericRemoteDocumentCacheTests(
360360
],
361361
version(3)
362362
);
363-
await cache.removeEntry(key('a/2'), version(4));
363+
await cache.removeEntry(key('a/2'));
364364

365365
const changedDocs = await cache.getNewDocumentChanges();
366366
assertMatches(

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

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,14 @@ export class TestRemoteDocumentCache {
7676
return this.addEntries([maybeDocument], maybeDocument.version);
7777
}
7878

79-
removeEntry(
80-
documentKey: DocumentKey,
81-
readTime: SnapshotVersion
82-
): Promise<void> {
79+
removeEntry(documentKey: DocumentKey): Promise<void> {
8380
return this.persistence.runTransaction(
8481
'removeEntry',
8582
'readwrite-primary',
8683
txn => {
87-
const changeBuffer = this.newChangeBuffer({ trackRemovals: true });
84+
const changeBuffer = this.newChangeBuffer();
8885
return changeBuffer.getEntry(txn, documentKey).next(() => {
89-
changeBuffer.removeEntry(documentKey, readTime);
86+
changeBuffer.removeEntry(documentKey);
9087
return changeBuffer.apply(txn);
9188
});
9289
}
@@ -131,9 +128,7 @@ export class TestRemoteDocumentCache {
131128
);
132129
}
133130

134-
newChangeBuffer(options?: {
135-
trackRemovals: boolean;
136-
}): RemoteDocumentChangeBuffer {
137-
return this.cache.newChangeBuffer(options);
131+
newChangeBuffer(): RemoteDocumentChangeBuffer {
132+
return this.cache.newChangeBuffer();
138133
}
139134
}

0 commit comments

Comments
 (0)