Repository navigation
fix(j5): the Inbox stops saying "loading" for a server that is off or retrying - #975
Conversation
…the Inbox J5's read sources treated a disabled server's "available" phase as still loading, so the Inbox, its count and web's J5 pages showed "<server>: loading…" for it forever. They now skip disabled servers, as upstream's thread and project lists do, and read "available" as not connecting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Upstream presents a connection attempt after a failure as reconnecting, and its query fails rather than waits. J5's read sources now read that attempt as offline, so a server that keeps retrying no longer switches between "loading…" and "offline". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Jacksondr5
left a comment
There was a problem hiding this comment.
Combined review: reviewer-opus and reviewer-sol (Claude Opus 5.5 and GPT Sol 6.1), head 7a3e28b
Both of us reviewed the PR independently. Neither found anything that blocks merge.
- Your first question: web's J5 views. Every
createJ5ReadSourcesAtomconsumer goes through the same loop, so a server the person turned off, or one withunsupportedReason, drops out of all of them consistently. On web that's the Inbox (open, answered, count), worktree cleanup (open, decided), Crew proposals, Crew runtime requests, Fleet and Fleet detail; on mobile, its Inbox atoms.- Before, such a server stayed a permanent "loading" source, which also kept
incompleteset, so the bell showed "?" or "N*". - Nothing in those views needs a turned-off server's cached rows. The rule is upstream's own:
enabledEnvironmentIdsgives the same predicate and order its thread and project lists use. - A filtered server gets no query, state or config read. The derivation still depends on the catalog, so turning the server back on restores it; reviewer-sol checked on→off→on with a real
AtomRegistry. - An enabled server that's offline keeps its cached data and its notice.
- Before, such a server stayed a permanent "loading" source, which also kept
- Your second question: the placeholder is safe. An unpublished state used to be read as
available, which mapped to loading. It's now read asconnecting, which also maps to loading, so the status is unchanged. available → offlinecan't flash on a working server.availableis the supervisor's not-desired state (desired: false). The registry creates every enabled server's supervisor withinitiallyDesired: entry.enabled && entry.unsupportedReason === undefined(registry.ts:369), so an enabled server startsconnectingoroffline, neveravailable.- Tests. They were written first and cover: a turned-off server left out and never queried, a server still starting reading as loading, and
availablereading as offline. 30 focused shared tests pass.
The panel has no open code findings. Before merge it still needs the tester's captures and green J5 CI.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Jacksondr5
left a comment
There was a problem hiding this comment.
Combined review: reviewer-opus and reviewer-sol, head 11f33c3
Both of us reviewed the retrying-server commit independently. Neither found anything.
-
Rule.
reconnecting = state !== null && (state.attempt > 1 || state.lastFailure !== null)is the exact complement of upstream'spresentConnectionStatetest for a first connection (attempt <= 1 && lastFailure === null). It only affects phaseconnecting: a retrying server reads offline, and saved rows show as "offline (showing saved results)". Unsupported and connected keep their precedence, and an unpublished state still reads loading. -
Checked with a real
AtomRegistry(reviewer-sol):attempt lastFailure status 1 none loading 2 none offline 1 a failure offline 2 a failure offline -
Tests. They were written first. 29 focused readSources, Inbox and connection-presentation tests pass.
Note (not blocking): a dropped connection restarts as connectingState(…, 1, latestFailure) (supervisor.ts:1154). So an ordinary reconnect, for example on app resume, briefly reads "offline (showing saved results)" where it read "loading…". Upstream calls that state "Reconnecting…". Offline is the truthful one of J5's existing statuses, so no new state is needed, but the tester may see the flash.
The panel has no open code findings. Before merge it still needs the captures and green J5 CI.
…pstream does Upstream presents a retry after a failure, and the wait before the next one, as reconnecting. A J5 source in that state keeps reading as offline, so saved rows stay, but its line now says "<server>: reconnecting…". "offline." stays for a client with no network. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Jacksondr5
left a comment
There was a problem hiding this comment.
Combined review: reviewer-opus and reviewer-sol, head 9d27f18
Both of us reviewed this commit independently. Neither found anything.
- Rule.
reconnectingnow matchespresentConnectionState's "Reconnecting" exactly: phasebackoff, orconnectingwithattempt > 1or alastFailure. - Output field.
J5ReadSource.reconnecting?: trueis set only when the status is offline, in the same style asguest?: true, so a connected or unsupported source never carries a stale flag. Consumers still see "offline", and their saved rows and the count's incompleteness are unchanged. - Notice. The shared
j5SourceNoticeprints ": reconnecting…", adding " (showing saved results)." when there's data, so web picks up upstream's word too. "offline." stays for phaseoffline, meaning no network. - Tests. They were written first and cover reconnecting with and without cached data, plus
backoff. 29 focused tests pass.
Our earlier note is settled: an ordinary reconnect after a dropped socket now reads "reconnecting…", as upstream does.
The panel has no open code findings. Before merge it still needs the captures and green J5 CI.
Problem
A saved server the person has turned off shows ": loading…" above the Inbox's asks forever, even after a pull to refresh (Jackson, Checkpoint 3 on his iPhone). A disabled server's connection phase is
available, and J5's read sources treatedavailableas still loading. Part of #958.What changed
createJ5ReadSourcesAtom(packages/client-runtime/src/j5/readSources.ts) now builds its sources from upstream'senabledEnvironmentIds, the same list upstream's thread and project lists are built from. A server the person turned off, or one this client can't use, is left out: no notice, no read, and it no longer holds the Inbox's loading state or marks the bell's count "last known". Turning it back on brings it back, starting as loading.resolveJ5ReadSourcenow readsavailableas offline, not loading, since nothing is connecting to it. It also takes upstream's rule for a server that keeps retrying: a retry after a failure, or the wait before the next one (presentConnectionState's "Reconnecting"), is not a first load. Such a source reads as offline, keeping its saved rows, and its line says ": reconnecting…", upstream's word. "offline." stays for a client with no network. Before, a stopped server could read either word, depending on the moment ("loading…" during an attempt, "offline." between attempts), and a disabled one read "loading…" forever. A dropped socket now reads "reconnecting…" briefly, not "loading…".The code is shared, so the fix covers every J5 read on web and mobile: the Inbox and its count, Crew proposals and runtime requests, worktree cleanup, and Fleet.
Tests: written first in
readSources.test.ts. Both failed onj5/main: a disabled server came back as "Off: loading", and both a resolvedavailablephase and a retrying connection came back as loading. A retrying source's line says "reconnecting…", and one with no network says "offline.". A server making its first connection still reads as loading.Not in this PR: the rest of #958, that every test server on one host calls itself "openclaw". That's rig work, so the issue stays open for it.
UI changes
Android, base
067d732e1a(before) and this PR's head (after), with a second saved server, "Secondary".After: Secondary retrying, with saved results.
After: Secondary back up, its line gone.
Before: Secondary stopped. It reads "offline." throughout this sample.
reconnecting-067d-before.mp4
After: Secondary stopped reads "reconnecting…", and the line goes when it restarts.
reconnecting-9d27-after.mp4
Before: a pull with Secondary turned off.
pull-disabled-067d-before.mp4
After: a pull with Secondary turned off.
pull-disabled-9d27-after.mp4
Live testing
Android: PASS at
9d27f18fc9, this PR's head, by the crew tester (Sol 6.1). One real Haiku 5.5 ask was on the primary server, with a second isolated test server saved as Secondary.1*).1).Not exercised:
Upstream impact
None. Only J5-owned files change.
Checklist
j5/mainBuilt by Claude Opus 5.5 in Claude Code (J5 crew seat builder-identity).
🤖 Generated with Claude Code