Skip to content

Say OpenBot's own sentence while an organization moves, and follow a removed member to an organization they're still in - #2111

Merged
davidmckayv merged 6 commits into
mainfrom
shard-app-notices
Nov 24, 2026
Merged

davidmckayv merged 6 commits into
mainfrom
shard-app-notices

Conversation

@davidmckayv

@davidmckayv davidmckayv commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Two things the end-to-end test of database sharding found in the web app. Neither needs a backend change: the server already answers both.

While an organization is moved

The server answers the organization's requests 503 in problem details, "OpenBot is moving this organization. Try again in a moment.", with Retry-After. Memory showed that sentence because it draws the error's own message. Routines, and most other screens, drew their own "Couldn't load your routines and goals and check-ins. Try again in a moment.", and stayed that way after the move ended.

  • ClientError keeps the server's own sentence (said) and Retry-After (retryAfterMs).
  • lib/load-failure.ts: loadFailure(error, own) is the shared rule. A 503 that carries a sentence and a Retry-After is shown in its words, as calm muted text, never in the destructive red the app keeps for what failed (the needs-you board, computers page, home's Bots card and the openfuse skin's notice drop their red box for it too). Any other failure keeps the screen's sentence, a plain 503 ("Service unavailable.") included. Every screen that draws a failed read's sentence now goes through it (about 80 places).
  • The query client doesn't retry such a 503 at once. It asks the read again once, by itself, after the Retry-After, so the screen fills in when OpenBot is back.
  • On Routines, the check-ins switch under the list doesn't repeat the sentence: it's said once for the page.

Loading a page while the organization is held

Reloading while an organization was moved, or while its database couldn't be reached ("This organization is unavailable right now. Try again in a moment."), showed "Something went wrong" with the ClientError and a stack trace. The app's error boundary now answers such a 503 with a calm page in the sign-in screen's frame: "Back in a moment", the server's sentence, and Try again. After the Retry-After it drops the failed reads and loads the route again by itself. It isn't reported as an app error.

Removed from the organization while in it

Its addresses answer 404 ORGANIZATION_NOT_FOUND "Couldn't find that organization." (what the end-to-end run recorded), and the addresses the session decides answer 403 "You're no longer a member of the organization you were working in. Switch to another one." Neither said anything a person could act on.

On either refusal the query client now reads the person's organizations again. The list already moves the session to one they're still in, and the app follows from home, as it follows a switch made in another window. A bar over the page says "You're no longer a member of Northwind Freight. You're now working in Dana's organization." Dismiss closes it. Any other refusal changes nothing: the list still names the organization.

Tests

Real-browser tests, Chromium and WebKit, at 1440 and 390, light and dark, added to CI's real-browser list:

  • app/tests/organization-moving.test.tsx: during a move, Routines says the server's sentence once and nothing of its own, each read is refused once, and after Retry-After the routine appears with nothing pressed.

  • app/tests/organization-removed.test.tsx: removed while on home, opening Routines lands them home in their own organization with the bar; Routines then shows their own routine; Dismiss closes it. For both the 404 and the 403.

  • app/tests/organization-held-reload.test.tsx: reloading Routines while held, for both sentences, shows "Back in a moment" with the server's sentence and no error screen, and Northwind's routine comes back with nothing pressed.

All three fail on main (the sentence and the bar never appear; the reload shows "Something went wrong") and pass here.

Ships with the sharding backend after the end-to-end test.

@davidmckayv
davidmckayv force-pushed the shard-app-notices branch 5 times, most recently from 6ac487c to 4d98a2d Compare November 24, 2026 18:14
@davidmckayv
davidmckayv enabled auto-merge (squash) November 24, 2026 18:14
…removed member to an organization they're still in

While an organization is moved between databases, the server answers its
requests 503 with "OpenBot is moving this organization. Try again in a
moment." and Retry-After. Memory showed that sentence because it drew the
error's message; Routines and most other screens drew their own "Couldn't
load ..." and stayed failed after the move ended.

- ClientError keeps the server's own sentence (`said`) and Retry-After.
- lib/load-failure.ts: loadFailure(error, own) is the shared rule. A 503
  that carries a sentence is shown in its words; anything else keeps the
  screen's sentence. Every screen that renders a failed read's sentence
  now goes through it.
- The query client doesn't retry such a 503 at once, and asks the read
  again once by itself after its Retry-After, so the screen fills in.

When a person is removed from the organization they're working in, its
addresses answer 404 ORGANIZATION_NOT_FOUND (or 403 in the server's
sentence at the session's addresses). The query client now reads their
organizations again on such a refusal; the list already moves the session
to one they're still in and the app follows from home, as it does a
switch made in another window. A bar says "You're no longer a member of
<organization>. You're now working in <organization>."

Real-browser tests for both, in Chromium and WebKit, at 1440 and 390,
light and dark; added to CI's real-browser list.
… back

A 503 without Retry-After is something that broke or isn't there ("Service unavailable."), and the screen's own sentence says it better. The move's 503 carries Retry-After.
…ds again by itself

Reloading while an organization was being moved, or while its database
couldn't be reached, showed "Something went wrong" with the ClientError and
a stack trace to copy. Both are the server answering as it should: 503, a
sentence for people, and Retry-After.

The app's error boundary now answers such a 503 with its own page in the
sign-in screen's frame: "Back in a moment", the server's sentence, and Try
again. After the Retry-After it drops the failed reads and loads the route
again by itself. Nothing is reported as an app error.

Real-browser test, Chromium and WebKit, 1440 and 390, light and dark, for
both sentences; added to CI's real-browser list.
…ive red

The shared rule showed the server's sentence ("OpenBot is moving this
organization. Try again in a moment.") inside each screen's red failure
line. The app keeps that red for what failed or deletes, and a move or a
brief outage is neither.

loadFailure now returns the server's sentence as muted text, which wins
over the red line around it, so every screen on the rule draws it calm.
The few places that wrap it in a red box or border (the needs-you board,
the computers page, home's Bots card, the openfuse skin's notice) draw
that calm too. A screen's own failure sentence keeps its look.
The Models dialog on a team (added on main alongside this branch) drew its own "Couldn't load the organization's models" in red for any failed read. It now goes through loadFailure like every other screen, so a move or a brief outage shows the server's sentence, calm and muted.
…only the ones that said their own sentence

With one database shard down, Memory said "This organization is unavailable right now. Try again in
a moment." in the destructive red, while Routines said it muted. The shared rule (loadFailure) only
reached screens that draw their own "Couldn't load ..." sentence. Memory, and about 160 other places,
draw the error's own message straight into a red line, so a held 503 looked like a failure there.

- lib/load-failure.tsx: failureSaid(error) is the one way to draw an error in its own words. A real
  failure keeps its words and the place's look; a 503 that says when to come back (a move, or the
  organization's database out of reach) is the server's sentence, drawn muted.
- Every `{x.error.message}` in the app goes through it now: Memory and its sources, Teams and a
  team's page, Routines, goals and triggers, the sidebar's Bots and conversations, Settings, Approvals,
  Bots' profiles, Connections and apps, Computers, Skills, Suggestions, Organizations and every Admin
  page. A few that passed the words on as a string (Memory's edit dialog, Computers' host folders,
  linked accounts, an app's account fields, openfuse's notices, Learning's settings) take the drawn
  sentence or the held look too. Real failures stay red.
- failure-said.test.ts fails if any page draws an error's message itself again.
- organization-unavailable-pages.test.tsx, in Chromium and WebKit at 1440 and 390, light and dark:
  Memory and Teams with the organization's database out of reach say the sentence once, not in red;
  Memory with a real failure still says it in red. Added to CI's real-browser list.
@davidmckayv
davidmckayv disabled auto-merge November 24, 2026 18:16
@davidmckayv
davidmckayv enabled auto-merge (squash) November 24, 2026 18:16
@davidmckayv
davidmckayv merged commit 95e7e1f into main Nov 24, 2026
35 checks passed
@davidmckayv
davidmckayv deleted the shard-app-notices branch November 24, 2026 19:13
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