(remote): distinguish unknown, unreachable and empty remote hosts - #234
Merged
Merged
Conversation
getRemoteSessions(alias) returned [] for three cases the sidebar could
not tell apart: never read, read with zero live sessions, and a failed
cycle (descriptors cleared on purpose). It now returns
{ sessions, at, error } instead of a bare array -- at is the last
successful cycle's timestamp (null if never), error is the last
failure's message (null if the last cycle succeeded) -- because a
failed cycle must not look identical to a genuinely idle host, nor
overwrite the last known-good timestamp. annotateRemoteAttachable
threads at/error onto each remote project and each session's live
status/statusUpdatedAt onto the sidebar payload.
The sidebar shows a host-level dot (unknown / unreachable with reason
/ empty / live with a count) next to the project name, and a per-session
status + age line so a 24h-old status never reads as a few seconds old.
Refs #212
…ranscript The badge tooltip was written before remote attach existed and claimed every remote row was a read-only mirror. It now reads the same remoteAttachable flag the click routing uses, so hover and click agree.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #212.
A remote host answering with an empty session list was indistinguishable from
a host that had never been read and from a host that could not be reached at
all. All three rendered the same way, so an SSH timeout looked exactly like an
idle VPS — which is what made the attach feature look broken last night when
the real cause was three SSH timeouts in two and a half hours.
Freshness contract
getRemoteSessions(alias)now returns{ sessions, at, error }instead of abare array:
at— epoch ms of the last cycle that completed without throwing,nullifthe host has never been read.
error— the last failure's message,nullwhen the last cycle succeeded.A failed cycle clears
sessionsbut never bumpsat, so staleness and failurestay separable. Both call sites are updated in the same commit.
What it shows
A dot on each remote project header:
not yet synced with this hosthost unreachable: <reason> (last confirmed 4m ago)no live session (confirmed 12s ago)2 live sessions (confirmed 12s ago)Each remote session row also carries its CLI status with the age of that
status —
idle · 26s agoversusidle · 23h ago. The descriptor'sstatusfield records the last transition, not a heartbeat, so a day-old state must not
be readable as a fresh one.
Badge tooltip
The badge title still claimed
Read-only session mirrored from <host>, writtenbefore attach existed. It now reads the same
remoteAttachableflag the clickrouting uses, so hover and click agree: attach for a live session, transcript
otherwise.
Verification
Every behaviour above is pinned by a mutation that turns the relevant test red:
forcing
remoteHostErrorfalse, hardcoding the age formatter, hardcoding thelive/empty class, and restoring the old badge wording.
task check: 1154 tests, 0 fail, lint 0 errors.