Skip to content

Fix mobile auth refresh 401 recovery loop - #9397

Merged
Git-on-my-level merged 1 commit into
mainfrom
codex/fix-auth-refresh-401-loop
Jul 10, 2026
Merged

Fix mobile auth refresh 401 recovery loop#9397
Git-on-my-level merged 1 commit into
mainfrom
codex/fix-auth-refresh-401-loop

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Fixes #9375

This PR fixes the mobile auth-refresh failure that caused repeated 401 conversation requests and a misleading signed-in shell.

  • Adds typed, bounded, UID-bound Firebase token refresh outcomes.
  • Prevents authenticated requests from degrading into anonymous traffic and handles 401 refresh/replay once.
  • Terminates dead sessions exactly once, cancels stale conversation/provider work, clears user-scoped state, and routes to localized reauthentication UI.
  • Adds privacy-safe auth telemetry, UID-scoped offline memory/goal storage, account-deletion teardown coverage, and a signed iOS/TestFlight canary.

Verification:

  • cd app && flutter test --no-pub — 704 tests passed.
  • flutter gen-l10n — zero untranslated-message warnings.
  • Targeted analysis had no compile errors.
  • Independent review gate approved.

The physical signed iOS canary was added but could not be run locally because no iOS device or simulator was available.

Review in cubic

Prevent authenticated requests from degrading to anonymous traffic, bind token refreshes to the originating Firebase UID, and terminate confirmed dead sessions exactly once.

Clear user-scoped provider/cache state, cancel stale async work and conversation retries, route to localized reauthentication UI, and add a signed iOS refresh canary.

Verification: cd app && flutter test --no-pub (704 passed); flutter gen-l10n (zero untranslated warnings); targeted dart analyze (no compile errors); git diff --check; independent agent review approved.

UI limitation: no physical iOS device or simulator was available for the signed canary; the reauthentication path was exercised through its Flutter widget regression test.
@Git-on-my-level

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: ce78805d5f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Git-on-my-level
Git-on-my-level merged commit 9c0f99e into main Jul 10, 2026
18 checks passed
@Git-on-my-level
Git-on-my-level deleted the codex/fix-auth-refresh-401-loop branch July 10, 2026 18:54
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.

Fix mobile auth-refresh failure: prevent 401 conversation retry loop and misleading signed-in UI

1 participant