Skip to content

Fix TabController disposal race during iOS scene-restore#1218

Open
zaelgohary wants to merge 1 commit intodevelopmentfrom
development_fix_tabcontroller_dispose_race
Open

Fix TabController disposal race during iOS scene-restore#1218
zaelgohary wants to merge 1 commit intodevelopmentfrom
development_fix_tabcontroller_dispose_race

Conversation

@zaelgohary
Copy link
Copy Markdown
Contributor

Summary

After completing phone/email verification on iOS, returning to the app via the SMS deep link can cause iOS to recreate the scene. Two HomeScreen instances briefly coexist: the new one assigns a fresh TabController to the global singleton in initState, then the old one's dispose runs and disposes whichever controller is currently in the global — including the new one. Tapping any home card after that hits a Null check on the disposed controller and freezes the UI.

Related Issue

Closes #1216

Changes

  • Tracked the locally-owned TabController in HomeScreen state and only disposed it if the global still pointed at it.

Test Results

Tested on iPhone (iOS 26.4.1) — phone verification flow completes, deep link returns to app, "Phone verified" dialog appears, home cards remain tappable.

@zaelgohary zaelgohary self-assigned this Apr 30, 2026
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.

App restarts and freezes after phone verification on iOS

1 participant