Repository navigation
π fix: settle contribute version footer loading state - #10703
Conversation
Handle inaccessible, invalid, and stalled version responses with a clear unavailable state. Keep API access restrictions and render version as text. Add browser-script regression coverage for success and failure paths. Hive-Run: hivecommons#10682 Hive-Plan: contribute-version-footer Hive-Spec: hivecommons#10682#expected-behavior Signed-off-by: arteeh <arteeh@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Read /api/version and the version plumbing, not just the diff. This looks correct to me, with one small visual regression worth a decision.
src/pkg/dashboard/api_version.go:30-34βversionis a constant andshortcomes fromversionShort, which defaults to"unknown"(api.go:446) and is set fromgitShort, itself defaulting to"unknown"(cmd/hive/main.go:176). So the new non-empty-string checks can never reject a real response.behindis genuinely optional:api_version.go:112-124only sets it when a cached upstream SHA exists, and:140-152only when a target resolved. The old footer rendered that case as π’ "up to date", which was wrong; the new βͺ "update status unavailable" is more honest. Good catch.- Timeout path:
finishclears the timer and thesettledflag stops a late success from overwriting the fallback;controller.abort()afterfinishmeans the rejected fetch lands in thecatchβfinishno-op. Verified against the test's stalled-header and stalled-body cases.
Visual regression (low): the old code used innerHTML so "update available" was wrapped in <span style="color:var(--cc-amber)">. The new textContent path at the finish(dot+β¦) call drops that colour, so the amber "update available" cue is now plain muted text. If that highlight matters, build the status with a child span (or set el.innerHTML only for the static suffix and textContent on a span holding d.version/d.short). If the π‘ dot is considered sufficient, this is fine as-is β maintainer's call.
Also: the diff fully fixes #10682, so Closes #10682 rather than Refs would keep the issue from lingering after merge.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
The Contribute footer could remain on
loading...indefinitely when/api/versionfailed. The public contributor page requests an API that the hosted auth rules explicitly classify as private (TestContributorLandingFetchesAreExplicitlyClassifiedForSaaSPublicAuth), so visitors without dashboard access can reach this failure path. The exact response on the reported deployment has not been independently observed.The footer now settles to βHive version unavailableβ on HTTP, network, JSON, or payload errors, and after a ten-second deadline covering both headers and body parsing. The deadline aborts the request and prevents late responses from overwriting the fallback. Successful responses show the version and update status; missing update metadata is explicitly unavailable. API values render through textContent. The initial HTML also has an unavailable fallback if JavaScript cannot run.
Refs #10682. This has not shipped to the reported hosted deployment; reporter confirmation is still needed after deployment.
Validation:
gofmt -lon changed Go files andgit diff --checkpassed. Added a Node-backed Go regression test exercising the served footer function for success, access denial, server errors, malformed payloads, network errors, stalled headers/body, timeout cancellation, and late completion. Tests were not run locally per AGENTS.md; CI is the test authority.β hive: backend=codex model=gpt-6-astra effort=medium
π Hive Agent:
contributor| SHA:7bf61adcc