Repository navigation
fix(browse): stop the hosted dashboard blaming the coordinator - #113
Conversation
Opening https://dashboard.local.han.guru showed "Connecting to Han Coordinator..." forever, told the visitor to run `han coordinator start`, and offered install instructions. All of it wrong: the coordinator answers /health with 200 while that page spins. Chrome 151 gates a public-origin page from reaching a loopback address behind the local-network-access permission, and the page cannot obtain it. A fetch carrying `targetAddressSpace: "loopback"` fails with and without a user gesture, and the permission stays at "prompt" either way. There is no navigator.requestLocalNetworkAccess. So that origin never connects, whatever the visitor does to their coordinator. The overlay now branches. When the page is public and the coordinator is a loopback target, it names the cause, quotes the host it was served from, and points at `han browse`, which serves the same dashboard from 127.0.0.1. No spinner and no "checking every 3 seconds", because waiting cannot grant a permission. On a loopback origin the coordinator instructions are correct and are kept. Verified in Chrome 151 against the real build: served from 10.4.1.221 it renders the cause and remedy with no coordinator blame; served from 127.0.0.1 it connects and renders the dashboard with no panels left loading. Both render tests were falsified by neutering the detector.
|
🚅 Deployed to the han-pr-113 environment in han-team-platform
3 services not affected by this PR
|
ReviewSolid, well-scoped fix. The diagnosis (Chrome 151's No CRITICAL issues found. MODERATEDuplicated hostname literal risks silent regression ( MINOR
Nice to haveTest coverage is thorough for the new logic (11 new tests across the helper and the component, including the "falsify by neutering the detector" check described in the PR body). No changes requested there. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Problem
#112madehan browseserve the dashboard from127.0.0.1, which works. It left the hosted URL reachable and permanently broken. Openinghttps://dashboard.local.han.gurustill shows:Every line of that is wrong. The coordinator is running and answering:
Anyone with that URL bookmarked, or following a link, gets a spinner forever and a list of remedies for a problem they do not have.
Why the page cannot fix itself
Chrome 151 gates a public-origin page reaching a loopback address behind the
local-network-accesspermission, and the page has no way to obtain it. Measured on the live origin:fetchTHREW Failed to fetchfetchwithtargetAddressSpace: "loopback"THREW Failed to fetchTHREW Failed to fetchpermissions.query({name:'local-network-access'})after all of it"prompt"navigator.requestLocalNetworkAccessundefinedtargetAddressSpaceis accepted as a Request option, so the hint is understood and still refused.Access-Control-Allow-Private-Network, added in #111, is the superseded PNA mechanism and Chrome 151 does not act on it. There is no server-side or client-side move that makes this origin work.Change
ConnectionOverlaybranches on whether the page can reach loopback at all.Blocked means page origin is public and the coordinator is a loopback target. Both halves matter: a page already on loopback is unrestricted, and a coordinator on a routable address is not gated, so in either of those cases a failure really does mean the coordinator is unreachable and the existing advice is right.
When blocked it names the cause, quotes the host it was served from, and points at
han browse. No spinner and no "checking every 3 seconds", because waiting cannot grant a permission.coordinator.local.han.gurucounts as loopback: it is a public DNS name pointing at127.0.0.1, so it is a loopback target that does not look like one.Verification
Real Chrome 151 against the real build, both origins.
Served from
10.4.1.221:4901:Served from
127.0.0.1:4902, same bundle:tscclean, relay clean, build cleanNote
This makes the hosted origin honest. It does not make it work, and nothing can while Chrome gates it. If the hosted dashboard should genuinely function some day, it needs a coordinator reachable at a routable address, which is a different product.