Skip to content

Commit 26d0992

Browse files
authored
Re-establish streams when App Check token expires. (#3328)
1 parent 2715647 commit 26d0992

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

firebase-firestore/src/main/java/com/google/firebase/firestore/core/FirestoreClient.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,13 @@ public FirestoreClient(
129129

130130
appCheckProvider.setChangeListener(
131131
(String appCheckToken) -> {
132-
// Register an empty credentials change listener to activate token
133-
// refresh.
132+
// This will ensure that once a new App Check token is retrieved, streams are
133+
// re-established using the new token.
134+
asyncQueue.enqueueAndForget(
135+
() -> {
136+
Logger.debug(LOG_TAG, "App Check token changed.");
137+
remoteStore.handleCredentialChange();
138+
});
134139
});
135140
}
136141

0 commit comments

Comments
 (0)