Skip to content

fix(mobile): keep account loaded after a failed identity refetch - #5981

Merged
iscekic merged 1 commit into
mainfrom
fix/mobile-resume-account-load
Sep 9, 2026
Merged

iscekic merged 1 commit into
mainfrom
fix/mobile-resume-account-load

Conversation

@iscekic

@iscekic iscekic commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Review and merge. After a long background, a failed user.getMe refresh no longer replaces the app with Could not load account.

Cause

  • Foreground refresh invalidates user.getMe.
  • A transient refetch error (radio not up yet) set isError even when the cached user was present.
  • Bootstrap treated that as a missing account. Retry then succeeded with the same cache.

Change

  • useCurrentUserId reports an identity error only when data is missing.
  • A cached user keeps the app up. Retry is still shown when there is no identity.

Test

  • apps/mobile: vitest run src/lib/hooks/use-current-user-id.test.ts — 5 passed.

Foreground refresh of user.getMe can fail after a long background while the
cached user is still valid. Bootstrap treated that as "could not load account".
@iscekic iscekic self-assigned this Sep 8, 2026
@iscekic
iscekic enabled auto-merge (squash) September 9, 2026 08:39
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.

2 participants