Files
buzz/mobile/test
Tom Brow f04fa0904c fix(mobile): close the community switcher when the org relay refuses the key (#9042)
## Summary

Follow-up to #9028 (merged).

#9028 closes the community switcher before content loads when
organization sign-in is needed, but it checks the session status once.
When the session is signed in and the relay then refuses the paired key
(`AccountFailure.denied`, which #9001 now saves on purpose), the Home
banner offers **Retry** and **Use a different account**, yet the
switcher keeps covering it until the 20s "taking longer" timeout.

- `organizationSignInPromptVisible()` in
`shared/hosted/organization_sign_in.dart` is now the single rule for
when the banner has an action. The banner uses it, and so does the
switcher.
- The switcher listens to the sign-in session and relay auth while it
waits for content, and closes as soon as the rule turns true. Listeners
are removed on every exit, including the timeout, and the content wait
stops listening once the prompt wins.
- Relay failures stay scoped to the new community's relay and pubkey, so
a stale failure from the previous community can't close the switcher.
- `checking` no longer closes the switcher early (the banner is hidden
then); a later transition to signed out still does.

### Related issue

Related to #9001, #9009 and #9028. No duplicate PR found.

### Testing

- New widget test: signed in, switch to an organization relay with
content pending, then the relay refuses the key, and the switcher
closes. It fails with #9028's one-shot check.
- `flutter analyze` is clean. The full mobile suite passes except 10
push and notification tests, which fail the same way on plain `main` on
this Mac (local environment; CI covers them).
- Pushed with `--no-verify` because of those 10 local failures.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Tom Brow <tomb@squareup.com>
Co-authored-by: Tom Brow <tomb@squareup.com>
Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 22:06:19 -07:00
..