@@ -128,8 +128,8 @@ - (instancetype)initWithDatabaseInfo:(const DatabaseInfo &)databaseInfo
128128 auto userPromise = std::make_shared<std::promise<User>>();
129129
130130 __weak typeof (self) weakSelf = self;
131- auto userChangeListener = [initialized = false , userPromise, weakSelf,
132- workerDispatchQueue ](User user) mutable {
131+ auto credentialChangeListener = [initialized = false , userPromise, weakSelf,
132+ workerDispatchQueue ](User user) mutable {
133133 typeof (self) strongSelf = weakSelf;
134134 if (!strongSelf) return ;
135135
@@ -138,14 +138,14 @@ - (instancetype)initWithDatabaseInfo:(const DatabaseInfo &)databaseInfo
138138 userPromise->set_value (user);
139139 } else {
140140 [workerDispatchQueue dispatchAsync: ^{
141- [strongSelf userDidChange : user];
141+ [strongSelf credentialDidChangeWithUser : user];
142142 }];
143143 }
144144 };
145145
146- _credentialsProvider->SetUserChangeListener (userChangeListener );
146+ _credentialsProvider->SetCredentialChangeListener (credentialChangeListener );
147147
148- // Defer initialization until we get the current user from the userChangeListener . This is
148+ // Defer initialization until we get the current user from the credentialChangeListener . This is
149149 // guaranteed to be synchronously dispatched onto our worker queue, so we will be initialized
150150 // before any subsequently queued work runs.
151151 [_workerDispatchQueue dispatchAsync: ^{
@@ -159,6 +159,7 @@ - (instancetype)initWithDatabaseInfo:(const DatabaseInfo &)databaseInfo
159159- (void )initializeWithUser : (const User &)user usePersistence : (BOOL )usePersistence {
160160 // Do all of our initialization on our own dispatch queue.
161161 [self .workerDispatchQueue verifyIsCurrentQueue ];
162+ LOG_DEBUG (" Initializing. Current user: %s" , user.uid ());
162163
163164 // Note: The initialization work must all be synchronous (we can't dispatch more work) since
164165 // external write/listen operations could get queued to run before that subsequent work
@@ -213,11 +214,11 @@ - (void)initializeWithUser:(const User &)user usePersistence:(BOOL)usePersistenc
213214 [_remoteStore start ];
214215}
215216
216- - (void )userDidChange : (const User &)user {
217+ - (void )credentialDidChangeWithUser : (const User &)user {
217218 [self .workerDispatchQueue verifyIsCurrentQueue ];
218219
219- LOG_DEBUG (" User Changed: %s" , user.uid ());
220- [self .syncEngine userDidChange : user];
220+ LOG_DEBUG (" Credential Changed. Current user : %s" , user.uid ());
221+ [self .syncEngine credentialDidChangeWithUser : user];
221222}
222223
223224- (void )applyChangedOnlineState : (FSTOnlineState)onlineState {
@@ -245,7 +246,7 @@ - (void)enableNetworkWithCompletion:(nullable FSTVoidErrorBlock)completion {
245246
246247- (void )shutdownWithCompletion : (nullable FSTVoidErrorBlock)completion {
247248 [self .workerDispatchQueue dispatchAsync: ^{
248- self->_credentialsProvider ->SetUserChangeListener (nullptr );
249+ self->_credentialsProvider ->SetCredentialChangeListener (nullptr );
249250
250251 [self .remoteStore shutdown ];
251252 [self .persistence shutdown ];
0 commit comments