Skip to content

Commit f15f1f0

Browse files
Remove Multi-Tab TODOs (#1161)
* Remove TODOs that are no longer applicable * [AUTOMATED]: Prettier Code Styling
1 parent 3f3b3a7 commit f15f1f0

File tree

6 files changed

+8
-16
lines changed

6 files changed

+8
-16
lines changed

packages/firestore/src/core/sync_engine.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,6 @@ export class SyncEngine implements RemoteSyncer, SharedClientStateSyncer {
811811
await Promise.all(queriesProcessed);
812812
this.syncEngineListener!.onWatchChange(newSnaps);
813813
this.localStore.notifyLocalViewChanges(docChangesInAllViews);
814-
// TODO(multitab): Multitab garbage collection
815814
if (this.isPrimary) {
816815
await this.localStore
817816
.collectGarbage()

packages/firestore/src/local/indexeddb_persistence.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,6 @@ export class IndexedDbPersistence implements Persistence {
907907
*/
908908
private markClientZombied(): void {
909909
try {
910-
// TODO(multitab): Garbage Collect Local Storage
911910
this.window.localStorage.setItem(
912911
this.zombiedClientLocalStorageKey(this.clientId),
913912
String(Date.now())

packages/firestore/src/local/indexeddb_remote_document_cache.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ export class IndexedDbRemoteDocumentCache implements RemoteDocumentCache {
106106
}
107107

108108
if (this.keepDocumentChangeLog) {
109-
// TODO(multitab): GC the documentChanges store.
110109
promises.push(
111110
documentChangesStore(transaction).put({
112111
changes: this.serializer.toDbResourcePaths(changedKeys)

packages/firestore/src/local/persistence.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ export type PrimaryStateListener = (isPrimary: boolean) => Promise<void>;
7979
* writes in order to avoid relying on being able to read back uncommitted
8080
* writes.
8181
*/
82-
// TODO(multitab): Instead of marking methods as multi-tab safe, we should
83-
// point out (and maybe enforce) when methods cannot safely be used from
84-
// secondary tabs.
8582
export interface Persistence {
8683
/**
8784
* Whether or not this persistence instance has been started.

packages/firestore/src/local/shared_client_state.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,6 @@ export class WebStorageSharedClientState implements SharedClientState {
571571
return !!(platform.window && platform.window.localStorage != null);
572572
}
573573

574-
// TOOD(multitab): Register the mutations that are already pending at client
575-
// startup.
576574
async start(): Promise<void> {
577575
assert(!this.started, 'WebStorageSharedClientState already started');
578576
assert(
@@ -761,15 +759,15 @@ export class WebStorageSharedClientState implements SharedClientState {
761759

762760
private handleLocalStorageEvent(event: StorageEvent): void {
763761
if (event.storageArea === this.storage) {
764-
// TODO(multitab): This assert will likely become invalid as we add garbage
765-
// collection.
766-
assert(
767-
event.key !== this.localClientStorageKey,
768-
'Received LocalStorage notification for local change.'
769-
);
770-
771762
debug(LOG_TAG, 'EVENT', event.key, event.newValue);
772763

764+
if (event.key === this.localClientStorageKey) {
765+
error(
766+
'Received LocalStorage notification for local change. Another client might have garbage-collected our state'
767+
);
768+
return;
769+
}
770+
773771
this.queue.enqueueAndForget(async () => {
774772
if (!this.started) {
775773
this.earlyEvents.push(event);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const KNOWN_TAGS = [
4545
DURABLE_PERSISTENCE_TAG
4646
];
4747

48-
// TOOD(mrschmidt): Make this configurable with mocha options.
48+
// TODO(mrschmidt): Make this configurable with mocha options.
4949
const RUN_BENCHMARK_TESTS = false;
5050

5151
// The format of one describeSpec written to a JSON file.

0 commit comments

Comments
 (0)