Skip to content

Commit 434c110

Browse files
Fix bug in terminate() (#3532)
1 parent 2bc2621 commit 434c110

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,12 @@ export class Firestore extends LiteFirestore
134134
debugAssert(!this._terminated, 'Cannot invoke _terminate() more than once');
135135
return this._queue.enqueueAndInitiateShutdown(async () => {
136136
await super._terminate();
137-
this._credentials.removeChangeListener();
138137
await removeComponents(this);
138+
139+
// `removeChangeListener` must be called after shutting down the
140+
// RemoteStore as it will prevent the RemoteStore from retrieving
141+
// auth tokens.
142+
this._credentials.removeChangeListener();
139143
});
140144
}
141145
}

0 commit comments

Comments
 (0)