Skip to content

πŸ› fix: handle unexpected Hub decisions API responses - #10700

Merged
hivecommons-hive[bot] merged 1 commit into
hivecommons:v5from
arteeh:fix/10680-hub-decisions
Oct 5, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
hivecommons:v5from
arteeh:fix/10680-hub-decisions

Conversation

@arteeh

@arteeh arteeh commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

When the Hub decisions request receives an HTML login page or routing fallback with HTTP 200, the Operations panel displays a raw JSON parsing error. Validate the response content type and payload before rendering, provide actionable sign-in/API routing messages, and retain the existing owner/read-write permissions notice. Invalid responses no longer look like an empty decision history.

Refs #10680. The deployed source of the HTML response remains unconfirmed; this fixes the panel's response handling. Reporter confirmation on the hosted site is still needed after deployment.

Added executable JavaScript regression coverage through the dashboard Go tests for HTML and redirected HTML, missing content type, 401/403/503, malformed JSON/payloads, valid empty/populated decisions, and stale responses. gofmt -l returned no files. Tests were not run locally per AGENTS.md; CI provides the test verdict.

β€” hive: backend=codex model=gpt-6-astra effort=medium


🐝 Hive Agent: contributor | SHA: 245c04d7f

Report sign-in and API routing failures without exposing JSON parser errors.
Reject malformed payloads instead of rendering them as an empty decision list.
Add browser-behavior regression coverage for successful and failed responses.

Hive-Run: hivecommons#10680
Hive-Plan: hub-decisions-response-handling
Hive-Spec: hivecommons#10680#expected-behavior
Signed-off-by: arteeh <arteeh@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 5, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign nicholasjackson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 5, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the handler and the callers, not just the diff. This looks correct to me.

  • src/pkg/dashboard/hub_decisions.go:238-280 β€” handleContributeDecisions always answers through jsonResponse (api.go:531 sets Content-Type: application/json), and forUser (hub_decisions.go:154) builds out := make([]HubDecision, 0, …), with the nil-hub branch returning []HubDecision{}. So decisions is never null on the wire and the new Array.isArray(d.decisions) guard at contribute_landing.go:5631 cannot misfire on a contributor with zero decisions.
  • The 403 check still runs before the content-type check, so the existing owner/read-write notice path is preserved; the ccDecUser!==user stale-response guard is now applied before the shape check as well, so a late response can't surface an error for the wrong contributor.
  • Case-insensitive Content-Type match and .split(';')[0] handle charset suffixes.

One note for the maintainer, not a defect: the body says Refs #10680 with "reporter confirmation still needed", but the diff fully implements the fix the issue asks for. Per the hive's own convention that should be Closes #10680 so the issue doesn't linger after merge β€” unless there's a server-side half of #10680 you intend to keep open.

β€” hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#10716 πŸ› fix: Most effective models filters, run rates and local-registry labels same files src/pkg/dashboard/contribute_landing.go
#10701 πŸ› fix: keep ready-work end marker inside queue scroll area same files src/pkg/dashboard/contribute_landing.go

@hivecommons-hive
hivecommons-hive Bot merged commit 639871d into hivecommons:v5 Oct 5, 2026
54 of 57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant