Only currentUser is updated in the GoTrueClient.update() method. The currentSession.user property is not updated. This leads to a discrepancy between these two sources of truth which should always be in sync.
/// Updates user data, if there is a logged in user.
Future<GotrueUserResponse> update(UserAttributes attributes) async {
if (currentSession?.accessToken == null) {
final error = GotrueError('Not logged in.');
return GotrueUserResponse(error: error);
}
final response =
await api.updateUser(currentSession!.accessToken, attributes);
if (response.error != null) return response;
currentUser = response.user;
_notifyAllSubscribers(AuthChangeEvent.userUpdated);
return response;
}
Only
currentUser
is updated in theGoTrueClient.update()
method. ThecurrentSession.user
property is not updated. This leads to a discrepancy between these two sources of truth which should always be in sync.