Skip to content

Sign out when the account is gone, instead of the generic error screen - #121

Merged
dadachi merged 3 commits into
mainfrom
fix/sign-out-when-account-is-gone
Oct 29, 2026
Merged

dadachi merged 3 commits into
mainfrom
fix/sign-out-when-account-is-gone

Conversation

@dadachi

@dadachi dadachi commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • A saved session whose account was deleted (the public demo deletes accounts unused for 30 days) now signs out and says the session has expired. Before, the app opened on the generic "Something went wrong" screen, and "Back to start" said [NATIVEAPPTEMPLATE-2001].
  • Cause: the API looks up the organization in the path (AccountNotFoundController) before the token, so the answer is account_not_found (404), not devise_token_auth's 401. The free edition did not handle account_not_found at all: Service now posts .apiSessionDidExpire for it, like a rejected token.
  • Same fix in NativeAppTemplate-iOS (sign out when the personal organization is gone) and NativeAppTemplate-Android / Free-Android.

Test plan

  • make lint, full test suite (ServiceTest.deletedAccountIsAnnouncedAsAnExpiredSession, and a 404 without the code is not)
  • iPhone (debug build × public demo): deleted the account from another app, relaunched this one with its saved session → "session expired", then the start screen

🤖 Generated with Claude Code

dadachi and others added 3 commits October 29, 2026 08:08
…red token

The API looks up the organization in the path before the token. A free
account has only its personal organization, which goes with the account
(deleted by the user, or by the public demo after 30 unused days), so a saved
session for it gets account_not_found, never devise_token_auth's 401, and the
app kept failing every request. Service now announces that 404 as an expired
session too, so the app signs out and says to sign in again.

Found on 2026-10-28 with the paid app (same fix in NativeAppTemplate-iOS).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dadachi
dadachi merged commit 497c145 into main Oct 29, 2026
2 checks passed
dadachi added a commit that referenced this pull request Oct 29, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dadachi
dadachi deleted the fix/sign-out-when-account-is-gone branch October 29, 2026 07:57
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