MOB-1672 defer realm clear on logout to fix crash - #3940
Open
FLGMwt wants to merge 1 commit into
Open
Conversation
Member
Author
|
@jtklein curious your thoughts on this since you last worked on reworking signOut around this issue. I tried an idea a while ago to navigate to an empty |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
closes MOB-1672
The "invalidated realm" issue seems to happen all the time now on Log Out (I think it used to be dependent on what you'd navigated to before logging out). It also now results in an unrecoverable native error instead of the js error that we could wrap in the Restart screen. We still have things to figure out with MOB-139 / MOB-1601. But this at least smooths over the user-facing problem.
Before:
On signOut, we delete Realm, but somewhere right after that before the RNRestart() is able to complete, Realm errors out because somewhere (callbacks, React Query, async stuffs?) we hold references to those deleted Realms.
After:
On signOut, we set a mmkv flag to delete realm on next "startup". This is explicitly done in
index.jsbefore anything has a chance to setup / use Realm and create a "invalid" object link.