File tree Expand file tree Collapse file tree 2 files changed +16
-9
lines changed
packages/firestore/src/core Expand file tree Collapse file tree 2 files changed +16
-9
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @firebase/firestore " : patch
3
+ ---
4
+
5
+ Fixes an issue that prevented the SDK from automatically retrieving custom User claims.
Original file line number Diff line number Diff line change @@ -118,10 +118,8 @@ export class FirestoreClient {
118
118
) {
119
119
this . credentials . setChangeListener ( user => {
120
120
logDebug ( LOG_TAG , 'Received user=' , user . uid ) ;
121
- if ( ! this . user . isEqual ( user ) ) {
122
- this . user = user ;
123
- this . credentialListener ( user ) ;
124
- }
121
+ this . user = user ;
122
+ this . credentialListener ( user ) ;
125
123
this . receivedInitialUser . resolve ( ) ;
126
124
} ) ;
127
125
}
@@ -199,11 +197,15 @@ export async function setOfflineComponentProvider(
199
197
const configuration = await client . getConfiguration ( ) ;
200
198
await offlineComponentProvider . initialize ( configuration ) ;
201
199
202
- client . setCredentialChangeListener ( user =>
203
- client . asyncQueue . enqueueRetryable ( async ( ) => {
204
- await handleUserChange ( offlineComponentProvider . localStore , user ) ;
205
- } )
206
- ) ;
200
+ let currentUser = configuration . initialUser ;
201
+ client . setCredentialChangeListener ( user => {
202
+ if ( ! currentUser . isEqual ( user ) ) {
203
+ currentUser = user ;
204
+ client . asyncQueue . enqueueRetryable ( async ( ) => {
205
+ await handleUserChange ( offlineComponentProvider . localStore , user ) ;
206
+ } ) ;
207
+ }
208
+ } ) ;
207
209
208
210
// When a user calls clearPersistence() in one client, all other clients
209
211
// need to be terminated to allow the delete to succeed.
You can’t perform that action at this time.
0 commit comments