Repository navigation
fix(fleet): sidebar client-side peer visibility (#1363) - #1364
Merged
jeonghun-jj-lee merged 1 commit intoSep 21, 2026
Merged
jeonghun-jj-lee merged 1 commit into
jeonghun-jj-lee merged 1 commit into
Conversation
…ter + synthesize canonical-server node (#1363) On a client, the sidebar fleet section showed only itself: readRoster unconditionally read the machine-local roster cache (empty on a client, since the roster is host-owned), and nothing rendered the server (never a roster row). Two sidebar-only changes: - readRoster is now role-aware: SERVER/standalone read the local cache synchronously (unchanged); a CLIENT proxy-reads the host's authoritative roster over the existing GET /amicode/roster (forwarded by the local service). Any failure is the honest unreachable state, never a fabricated or stale list. The seam returns a sync|Promise union so every existing synchronous injection is untouched. - buildFleetSectionModel synthesizes the canonical-server node on a client (from fleet.json canonical), mirroring the existing self-row synthesis, so the server is visible; shown as down when the host is unreachable. Sidebar-only: enroll verb, roster schema, and guard are byte-unchanged. The roster-row enrichment (friendly name + device_type) is deferred to ADR 0027 (#1340 / PR #1353), which owns the roster schema. Closes #1363
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
jeonghun-jj-lee
deleted the
fix/1363-sidebar-client-roster-visibility
branch
September 21, 2026 12:20
jeonghun-jj-lee
added a commit
that referenced
this pull request
Sep 23, 2026
…ter + synthesize canonical-server node (#1363) (#1364) On a client, the sidebar fleet section showed only itself: readRoster unconditionally read the machine-local roster cache (empty on a client, since the roster is host-owned), and nothing rendered the server (never a roster row). Two sidebar-only changes: - readRoster is now role-aware: SERVER/standalone read the local cache synchronously (unchanged); a CLIENT proxy-reads the host's authoritative roster over the existing GET /amicode/roster (forwarded by the local service). Any failure is the honest unreachable state, never a fabricated or stale list. The seam returns a sync|Promise union so every existing synchronous injection is untouched. - buildFleetSectionModel synthesizes the canonical-server node on a client (from fleet.json canonical), mirroring the existing self-row synthesis, so the server is visible; shown as down when the host is unreachable. Sidebar-only: enroll verb, roster schema, and guard are byte-unchanged. The roster-row enrichment (friendly name + device_type) is deferred to ADR 0027 (#1340 / PR #1353), which owns the roster schema. Closes #1363
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 #1363. Fixes the reported bug: on a client machine the sidebar fleet section shows only itself; the canonical server never appears (on the server, both do).
Root cause
The sidebar's
readRosterseam unconditionally read the machine-local roster cache — empty on a client, because the roster is host-owned (written only on the server viaPOST /amicode/roster). The client-side proxy read was an explicit#1321follow-up. Compounding it, the server is never a roster row — it appears only via the machine's own self-row synthesis, so a client had nothing to render for it.Changes (sidebar-only)
readRosteris role-aware. SERVER/standalone read the local cache synchronously (unchanged); a CLIENT proxy-reads the host's authoritative roster over the existingGET /amicode/roster(forwarded by the local service). Any failure — no live endpoint, network error, non-200, malformed body — is the honestreachable:falsestate, never a fabricated or stale list. The seam returns async | Promiseunion, so every existing synchronous injection is untouched (no test churn).buildFleetSectionModelsynthesizes the server node on a client (fromfleet.jsoncanonical), mirroring the existing self-row synthesis; shown asdownwhen the host is unreachable, and never doubled (self-row / existing roster row de-dupe).extension.tspasses a lazy service-endpoint getter (the service boots after sidebar construction → null until up ⇒ honest degrade).Scope / non-goals
name+device_type— why the server currently renders the laptop asJJs-MacBook-Pro.local / clientvs the laptop's ownJJ's Macbook Pro / laptop) touches the schema + enroll verb and is deferred to ADR 0027 (Peer fleet studios + compute federation (ADR 0027) #1340 / PR Peer fleet studios (ADR 0027, Horizon 1) — #1341–#1346 #1353), which owns the roster schema.Testing
sidebar_fleet_section.test.ts: +4 pure-unit cases for the canonical-server synthesis (present / de-dupe / not-for-local / down-when-unreachable).sidebar_view.test.ts: +5 deps cases (client proxy-read with credential; client degrade on throw / no-endpoint; server reads local & never fetches;readCanonicalServerclient-vs-server) +1 provider-level async end-to-end (client posts a fleet-status including the synthesized server node).tsc --noEmitclean.Known follow-up (for the reviewer / ADR 0027)
If a server ever self-registers a roster row, its
machine_id(hostname) may differ from the canonicalhoststring used for synthesis — a de-dupe reconciliation that belongs with gap 3's roster-identity work.HITL — do not merge on my account; human promotes. Base is
feature/free-tier-fleet(notmain).