Skip to content

fix: metro graph handoff after logout [WPB-26140] [WPB-26141]#4932

Open
MohamadJaara wants to merge 4 commits into
developfrom
mo/fix/metro-graph-handoff
Open

fix: metro graph handoff after logout [WPB-26140] [WPB-26141]#4932
MohamadJaara wants to merge 4 commits into
developfrom
mo/fix/metro-graph-handoff

Conversation

@MohamadJaara
Copy link
Copy Markdown
Member

@MohamadJaara MohamadJaara commented Jun 4, 2026

https://wearezeta.atlassian.net/browse/WPB-26140

Summary

Fixes the logout/login handoff after the Hilt to Metro migration.

What was happening

On logout, the app clears the current user while Compose may still be drawing the old logged-in screen. That old screen still needs the session ViewModel graph for a short moment.

Keeping that graph around fixed the logout crash, but the login screen could briefly reuse the old user-scoped ViewModel key.

Also logging in with a second account was not working

Fix

  • Keep the last session graph alive briefly during logout.
  • Release it once the app reaches the login/auth flow.
  • Make auth ViewModels always use the auth scope, even during that short transition.

Testing

Manual verification

@MohamadJaara MohamadJaara force-pushed the mo/refactor/nuke-hilt branch from 6b85347 to 5b718bf Compare June 4, 2026 12:01
@MohamadJaara MohamadJaara changed the title fix: metro graph handoff after logout fix: metro graph handoff after logout [WPB-26140] [WPB-26141] Jun 4, 2026
Base automatically changed from mo/refactor/nuke-hilt to develop June 4, 2026 15:25
@MohamadJaara MohamadJaara requested a review from a team as a code owner June 4, 2026 15:25
@MohamadJaara MohamadJaara requested review from alexandreferris, ohassine, sbakhtiarov, typfel and yamilmedina and removed request for a team June 4, 2026 15:25
@pull-request-size
Copy link
Copy Markdown

Ups 🫰🟨

This PR is too big. Please try to break it up into smaller PRs.

# Conflicts:
#	app/src/androidTest/kotlin/com/wire/android/TestCoreLogicModule.kt
#	app/src/main/kotlin/com/wire/android/ui/WireActivity.kt
#	features/cells/src/main/java/com/wire/android/feature/cells/ui/CellsViewModelFactory.kt
#	features/cells/src/main/java/com/wire/android/feature/cells/ui/OpenFileDownloadController.kt
#	kalium
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 4, 2026

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant