Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
useEffect
does what it is supposed to do, which is to rerun the function body when the target property changes, i.e.,user
. So when we log out and invalidate the user, it runs again and saves the current user ID back to the storage while the user information is deleted. That causes the sync mechanism, which uses the userId to look for the User's information, now, not exist in the database any more after being logged out and hasn't been populated yet from the login success call, ultimately returning error and aborting the sync mechanism, leading to the user doesn't see the applicable changes they suppose to see on the phone.Tested by logout and log back in while monitoring the Isar database for a couple dozen times to make sure that the current user id and user information are deleted when logging out
Fixes #9065