File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change
1
+ # Unreleased
2
+ - [ fixed] Fixed an AppCheck issue that caused Firestore listeners to stop
3
+ working and receive a "Permission Denied" error. This issue only occurred for
4
+ AppCheck users that set their expiration time to under an hour.
5
+
1
6
# v8.11.0
2
7
- [ fixed] Fixed an issue that can result in incomplete Query snapshots when an
3
8
app is backgrounded during query execution.
Original file line number Diff line number Diff line change @@ -145,10 +145,23 @@ std::shared_ptr<FirestoreClient> FirestoreClient::Create(
145
145
};
146
146
147
147
shared_client->app_check_credentials_provider_ ->SetCredentialChangeListener (
148
- [](std::string) {
149
- // Register an empty credentials change listener to activate token
150
- // refresh.
148
+ [weak_client](const std::string&) {
149
+ auto shared_client = weak_client.lock ();
150
+ if (!shared_client) return ;
151
+ // It is okay to ignore an App Check token change notification if
152
+ // FirestoreClient::Initialize has not been invoked yet because
153
+ // once initialization does occur, setting up new watch streams will use
154
+ // the latest App Check token available.
155
+ if (shared_client->credentials_initialized_ ) {
156
+ shared_client->worker_queue_ ->Enqueue ([shared_client] {
157
+ LOG_DEBUG (" App Check token Changed." );
158
+ // This will ensure that once a new App Check token is retrieved,
159
+ // streams are re-established using the new token.
160
+ shared_client->remote_store_ ->HandleCredentialChange ();
161
+ });
162
+ }
151
163
});
164
+
152
165
shared_client->auth_credentials_provider_ ->SetCredentialChangeListener (
153
166
credential_change_listener);
154
167
You can’t perform that action at this time.
0 commit comments