Skip to content

Commit aaeab08

Browse files
Fix compilation for MemoryRemoteDocumentCache (#5950)
1 parent 6555aa7 commit aaeab08

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

packages/firestore/src/core/sync_engine_impl.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,9 @@ export async function syncEngineRejectListen(
619619
let documentUpdates = new SortedMap<DocumentKey, MutableDocument>(
620620
DocumentKey.comparator
621621
);
622+
// TODO(b/217189216): This limbo document should ideally have a read time,
623+
// so that it is picked up by any read-time based scans. The backend,
624+
// however, does not send a read time for target removals.
622625
documentUpdates = documentUpdates.insert(
623626
limboKey,
624627
MutableDocument.newNoDocument(limboKey, SnapshotVersion.min())

packages/firestore/src/local/indexeddb_lru_delegate_impl.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717

1818
import { ListenSequence } from '../core/listen_sequence';
19+
import { SnapshotVersion } from '../core/snapshot_version';
1920
import { ListenSequenceNumber, TargetId } from '../core/types';
2021
import { DocumentKey } from '../model/document_key';
2122

@@ -153,7 +154,7 @@ export class IndexedDbLruDelegateImpl implements IndexedDbLruDelegate {
153154
// Our size accounting requires us to read all documents before
154155
// removing them.
155156
return changeBuffer.getEntry(txn, docKey).next(() => {
156-
changeBuffer.removeEntry(docKey);
157+
changeBuffer.removeEntry(docKey, SnapshotVersion.min());
157158
return documentTargetStore(txn).delete(sentinelKey(docKey));
158159
});
159160
}

packages/firestore/src/local/memory_persistence.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import { User } from '../auth/user';
1919
import { ListenSequence } from '../core/listen_sequence';
20+
import { SnapshotVersion } from '../core/snapshot_version';
2021
import { ListenSequenceNumber, TargetId } from '../core/types';
2122
import { Document } from '../model/document';
2223
import { DocumentKey } from '../model/document_key';
@@ -284,7 +285,7 @@ export class MemoryEagerDelegate implements MemoryReferenceDelegate {
284285
const key = DocumentKey.fromPath(path);
285286
return this.isReferenced(txn, key).next(isReferenced => {
286287
if (!isReferenced) {
287-
changeBuffer.removeEntry(key);
288+
changeBuffer.removeEntry(key, SnapshotVersion.min());
288289
}
289290
});
290291
}
@@ -422,7 +423,7 @@ export class MemoryLruDelegate implements ReferenceDelegate, LruDelegate {
422423
return this.isPinned(txn, key, upperBound).next(isPinned => {
423424
if (!isPinned) {
424425
count++;
425-
changeBuffer.removeEntry(key);
426+
changeBuffer.removeEntry(key, SnapshotVersion.min());
426427
}
427428
});
428429
});

0 commit comments

Comments
 (0)