Skip to content

MOB-1672 defer realm clear on logout to fix crash - #3940

Open
FLGMwt wants to merge 1 commit into
mainfrom
MOB-1672-defer-realm-clear-on-logout-to-prevent-crash
Open

MOB-1672 defer realm clear on logout to fix crash#3940
FLGMwt wants to merge 1 commit into
mainfrom
MOB-1672-defer-realm-clear-on-logout-to-prevent-crash

Conversation

@FLGMwt

@FLGMwt FLGMwt commented Aug 13, 2026

Copy link
Copy Markdown
Member

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.js before anything has a chance to setup / use Realm and create a "invalid" object link.

@semanticdiff-com

Copy link
Copy Markdown

Review changes with  SemanticDiff

@FLGMwt
FLGMwt requested a review from jtklein August 13, 2026 16:37
@FLGMwt

FLGMwt commented Aug 13, 2026

Copy link
Copy Markdown
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 /logout navigator / screen & Mortal the rest, but of course that still didn't solve callbacks / async with references.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant