Repository navigation
Horizon API + web: fix Track 4 integration bugs and bearer auth - #140
Merged
Merged
Conversation
- Select runs with Track 4's status 'published' (running/scored/failed are
never readable). The API only accepted 'complete', which Track 4 never
writes, so every rankings request would have returned 404.
- Accept Track 4 member statuses (ranked, insufficient_data,
group_too_small). group_too_small rows previously failed response
validation (500). No non-ranked row may carry a score or rank.
- Accept bucket_scores as Track 4 publishes it ({key: score}); bucket
weight is optional. Add comparisonGroupLabel.
- Member history stops at the selected run, so an older week no longer
shows later weeks.
- Order unranked rows by name instead of user id.
- Disable prepared statements on the pool (Supabase transaction pooler).
- Unknown routes and wrong methods use the {"error": {...}} envelope.
- Regenerate openapi.json. Six regression tests, each failing before.
The web client sent same-origin cookies, but the Horizon API only accepts Authorization: Bearer, so every live read would have been rejected with 401. The auth adapter now exposes getAccessToken(); the read client sends the token as a bearer header with credentials omitted, refuses to fetch without a token, and rejects malformed tokens. The adapter still returns no token until Authentik sign-in (T7.1) exists, so the release gates stay closed. Also align the provisional T6.2 types with Track 4 statuses (group_too_small) and optional bucket weights.
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.
Fixes bugs found running the Horizon API and web app (from #132/#133) against Track 4's real schema. Spec drift is intentionally left alone.
API
publishedstatus (it only acceptedcomplete, which Track 4 never writes, so every rankings request would 404).group_too_smallmember rows (previously a 500).bucket_scoresas {key: score}; addcomparisonGroupLabel.prepare_threshold=Nonefor the Supabase transaction pooler.Web
Authorization: Bearer(the client sent cookies, which the API rejects with 401). Still locked until T7.1 sign-in exists.Tests
@tvworks22 could you review? It's your code 🙏