Skip to content

Commit dce5edc

Browse files
Review
1 parent e7fc1d3 commit dce5edc

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

packages/firestore/src/local/local_store.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -879,11 +879,10 @@ export class LocalStore {
879879
keepPersistedTargetData: boolean
880880
): Promise<void> {
881881
const targetData = this.targetDataByTarget.get(targetId);
882-
883-
if (targetData === null) {
884-
logDebug(`Ignoring release of nonexistent target: ${targetId}`);
885-
return Promise.resolve();
886-
}
882+
debugAssert(
883+
targetData !== null,
884+
`Tried to release nonexistent target: ${targetId}`
885+
);
887886

888887
const mode = keepPersistedTargetData ? 'readwrite' : 'readwrite-primary';
889888
return this.persistence

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ describeSpec(
102102
// The primary client 0 receives a notification that the query can
103103
// be released, but it can only process the change after we recover
104104
// the database.
105+
.expectActiveTargets({ query})
105106
.recoverDatabase()
106107
.runTimer(TimerId.AsyncQueueRetry)
107108
.expectActiveTargets()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ export class SpecBuilder {
446446

447447
/** Overrides the currently expected set of active targets. */
448448
expectActiveTargets(
449-
...targets: Array<{ query: Query; resumeToken: string }>
449+
...targets: Array<{ query: Query; resumeToken?: string }>
450450
): this {
451451
this.assertStep('Active target expectation requires previous step');
452452
const currentStep = this.currentStep!;

0 commit comments

Comments
 (0)