Skip to content

fix(platform): say when your teams fail to load on the account page - #4296

Merged
yannickmonney merged 2 commits into
mainfrom
fix/account-teams-read-error
Oct 4, 2026
Merged

yannickmonney merged 2 commits into
mainfrom
fix/account-teams-read-error

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

What changed

When the membership read failed, Settings › Account › Your teams said "You are not in any team yet", with no way to retry. That is the page that tells a member which team documents, projects and inbox queues they can see. #3846 and #3847 are the same report, and this one fix closes both.

  • Root cause. useTeams() (settings/teams/hooks/queries.ts) returned only data and isLoading. TeamsSection branched on isLoading and the list length, so an undefined list after a failed read showed the empty-membership copy.
  • Hook. useTeams() now also returns the shared read state from readStateOf (app/lib/backend/read-state.ts: unavailable, stale, retrying, failureCount) and a retry. The change is additive; the other consumers (account menu, documents, projects, inbox) still read only teams.
  • Section. A failed read shows the design-system CatalogLoadError: "Couldn't load your teams." with Try again.
    • react-query resets a never-answered read to pending when it retries. Because readStateOf holds the failure through that reset, the notice stays mounted during the retry. Its button goes busy (aria-busy/aria-disabled), not natively disabled, so a focused Try again keeps the focus, including when the retry fails again.
    • A retry that works removes the notice. The focus then moves to the section, a named region (tabIndex=-1, as EntityViewSection does), not to the page body.
    • A failed refresh keeps the last teams and says "Couldn't refresh your teams. What's shown may be out of date."
    • "You are not in any team yet" now appears only when the read succeeds and returns no teams.
  • Copy. Two new keys, settings.account.teams.loadFailed and settings.account.teams.refreshFailed, in EN/DE/FR. The German strings have no ß, so de-CH needs no override. Try again is the existing common.actions.tryAgain.
  • Docs and manual layer. The member guide (docs/{en,de,fr}/platform/member/preferences.md#teams) now says what a failed read shows. A new manual box, SET-B32, blocks /api/app/teams/mine in a real browser. A new automation.md row says which part the component spec covers.

Verification

All runs were local jsdom, one worker, /opt/node/bin/node v24.21.0.

  • New regression test: teams-section.read-failure.test.tsx runs the real hook, myTeamsQuery, backendFetch and the four-attempt retry against the repo's synthetic transport (tests/utils/synthetic-backend, a 503). It passes 8/8 on this branch. It covers:
    • the failed read;
    • Try again staying busy and focused during the retry and after a second failure (8 requests in all);
    • a successful retry moving focus to the section;
    • the successful-empty control;
    • a failed refresh over loaded teams;
    • the EN/DE/FR copy, with the DE and FR keys checked against the English fallback.
  • Against main: with the non-test files reverted to main (git show origin/main:<file>), 7 fail and 1 passes; the pass is the successful-empty control. Each failure is Unable to find role="alert", and the DOM dump shows "You are not in any team yet…" after the four failed attempts.
    • Single-file mutants: reverting only queries.ts fails 7, reverting only teams-section.tsx fails 7, and reverting only de.yml or only fr.yml fails that locale's test. So every layer is pinned.
  • Existing tests: the existing teams-section.test.tsx and the direct consumers' suites (user-button, documents-table ×2, projects-table, conversations-list, home-inbox-list ×2) all pass: 96 tests in 9 files.
  • Other checks:
    • lib/i18n/messages.test.ts: 24 passed;
    • tests/guards/error-message-description.guard.test.ts: passed;
    • docs locale/structure/link suites: 31 passed;
    • bun run lint:links, bun run lint:manual and check-guide.ts on settings.md: OK;
    • oxlint --type-aware on the changed TS files: clean;
    • scoped tsc over the changed files (2,650 program files): clean;
    • oxfmt, conflict-marker check and commitlint: clean.
  • Overlap with open PRs: fix(platform): preserve project audience on failed team reads #4275 (TALE-240) changes useOrgTeams() in the same queries.ts; this PR changes only useTeams(). git merge-tree merges both orders cleanly to the same tree. Clean trial merges with fix(platform): block team edits while saving #4286, fix(platform): refresh current user after account name saves #4262 and fix(platform): preserve team roster drafts on refresh #4233 too. SET-B31 is taken by fix(platform): correlate device setup with its join command #4257, so this box is SET-B32, placed next to SET-B15 rather than at the end of the section, where fix(platform): correlate device setup with its join command #4257 inserts.

Limits

  • No browser or visual-analyzer pass, and no native stack: SET-B32 covers that.
  • jsdom moves focus off a removed button the way a browser does, but the screen-reader announcement is untested.
  • The local SAST scan was skipped (opengrep is not cached here); the CI SAST job covers it.
  • No whole-platform suite and no whole-workspace tsc.

Closes #3846
Closes #3847

Account settings › Your teams turned a failed membership read into "You
are not in any team yet", with no way to try again: useTeams() dropped
the read's error and retry, and the section branched on the loading flag
and the list length alone.

useTeams() now reports how its read stands through readStateOf, and the
section names a failed read with CatalogLoadError and Try again. The
notice holds through the retry with its button busy, not disabled, so a
focused Try again keeps the focus; a retry that works hands the focus to
the section instead of the page. A failed refresh keeps the last teams
and says they may be out of date. "Not in any team" stays for a read
that answered with no teams.

New copy in EN/DE/FR, the member guide says what a failed read shows in
all three languages, and SET-B32 covers the blocked request in a real
browser beside its automation row.

Closes #3846
Closes #3847
@yannickmonney yannickmonney added bug Bug service: platform Platform service labels Oct 4, 2026
A request blocked in DevTools gets no response, so the app reads it as a lost connection and the offline overlay can cover the page while the read retries. The box no longer asks for focus checks under the block; the busy, focused Try again stays with the component spec, as its automation row says.
@yannickmonney

Copy link
Copy Markdown
Contributor Author

Independent review — ACCEPT

Reviewed PR #4296 at exact head a3280997e1684ba5be8c783f5c9c86c060b5dff1 (unchanged during review). This is an independent review: the implementation author is agent #3 (4aec6e61), while this review is by agent #11 (7a7d20b9).

Evidence

Limits / not rerun
No browser/native or visual-analyzer pass, no whole-platform suite or whole-workspace typecheck, and no local SAST (the PR also records the SAST cache limitation). CI was not rerun or cancelled. The manual SET-B32 update appropriately leaves browser focus assertions to the jsdom component spec.

@yannickmonney
yannickmonney merged commit 32783f1 into main Oct 4, 2026
@yannickmonney
yannickmonney deleted the fix/account-teams-read-error branch October 4, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Bug service: platform Platform service

Projects

None yet

1 participant