Repository navigation
Sync upstream fixes without changing the preview design - #32
Merged
github-actions[bot] merged 27 commits intoNov 9, 2026
Merged
Conversation
A server skips submitting runs that aren't faster than the player's
SourceJump PB (docs/domain.md), but reading those meant one leaderboard
request per player, style and track on every map change.
GET /v1/maps/{map}/personal-bests?players= takes up to 64 SteamID64s and
answers every style and track at once, with each best's rank, under the
same ETag as the map's records.
docs/api.md drops three sentences that repeat other docs, to stay within
its size budget.
The board's top 25 comes with the map, so a player further down had to page with "Show more" to find themselves. The board now asks for their entry (the leaderboard's existing `player=`) and pins it under the top, set apart, until "Show more" reaches it. Only on the 2.0 board, which is the one that ranks them, and only when they aren't already in the top. TableRow gets `separated` for a row that starts a group apart.
Every query that needed a track's current tier repeated "newest assignment first, take one" against map_tiers, in 14 places across 8 files. The current_map_tiers view (migration 0052) says it once. Conditions on map_id and track still reach the primary key through it, so a single lookup reads the same index rows as before. Behavior is unchanged; whether tiers are in force (the tiers policy) is still each caller's call.
tokio's Unix signals don't exist on other systems, so the API didn't compile on Windows at all, which kept contributors there from running its tests or the API itself. On Unix nothing changes: systemd still stops it with SIGTERM and in-flight requests finish. Elsewhere it stops with Ctrl+C.
A session lasts 30 days from its last use, and signing out ended only the browser it came from, so a session left on someone else's computer stayed signed in with no way to end it. POST /v1/auth/sign-out-everywhere ends every session of the signed-in player and clears this browser's cookie; like sign-out, it needs our Origin, and without a live session it only clears the cookie. The account menu has "Sign out everywhere" under "Sign out", as a plain form post like it. docs/site-api.md drops where the auth endpoints are served from (Caddy or Next.js), which docs/deploy.md has, to stay within its size budget.
Links to SourceJump get shared on Discord all the time, but pages set only a title, so a preview said nothing about the record. Map, run and player pages now set a description and Open Graph and Twitter card tags: a map's tier, the world record of the board it opens on and its players; a run's time, style, track and place; a player's finished maps and world records. Map and run previews show the map's cover, player previews the avatar. They reuse the pages' own per-request reads, so a preview costs no extra API request. An unexpected failure while rendering a page now shows a "Something went wrong" page with "Try again", inside the site's header and footer, instead of Next.js's bare error screen.
Let players sign out everywhere
Build the API on Windows: listen for SIGTERM only on Unix
Read the tier in force from one view instead of 14 copies
Show link previews for maps, runs and players, and an error page
Show signed-in players their own place on a map's leaderboard
Give servers their players' personal bests on a map in one request
Shared links showed text only, or a raw cover. Each map with a cover now gets one stored 1200×630 JPEG link card (cover, wordmark, tier icon, name), drawn in the API and named by content so caches keep it for good. Only data that rarely changes goes on it, so cards don't go stale and there is one per map however many runs are linked; run links use their map's card. A job draws a card when the cover or tier in force changes and deletes the one it replaces. It sleeps until triggers on map_images, map_tiers and policies wake it, with an hourly fallback pass. Pages without a card (maps without a cover, players, everything else) show web/public/link-card.jpg, drawn from the home header by the API's new site-card command so it matches. The web app now gets its public address at build time (SJ_SITE_URL, set by just deploy) for the whole addresses link previews need. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Give link previews a card per map and a site-wide card
A deploy runs `next build` with no API to reach, and nothing ran it before then. Doing so showed three components that read the API while the site was being prerendered: the home page's latest records and servers, the server list and the daily totals charts. With the API unreachable the build failed there. They now wait for a request first (`connection()`), as `currentRuleset` already does, so the pages stay dynamic and nothing from build time lands in the static shell. CI runs `next build` after the tests, so a page that does this again fails a pull request instead of a deploy. It stays out of `just check`, as it writes the `.next/` that `next dev` is using.
Git for Windows defaults to core.autocrlf=true, which checks text files out with CRLF. Checks that compare bytes then fail on a clean checkout: the doc budget counts the CR bytes (api.md and site-api.md go over 10000), and the committed OpenAPI spec no longer matches the generated one. `eol=lf` keeps the working tree LF on every OS. The repository's contents don't change: everything was already committed as LF.
A server with a broken clock (finished_at 0 is 1970) could have its runs placed at the start of a board's history, where they win ties and rewrite WR history. No ranked run can be older than the ruleset version it names or the server that sent it, so check_ruleset now refuses one with a 422, allowing the same 5 minutes of clock slack as for times ahead. servers.created_at rather than the key's: runs queued under a replaced key are still valid. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The ingest recounts the standings last, under the standings lock, with the statement limit lifted. Behind a full recount (a points or tiers policy published, or a new formula after a deploy), which takes seconds, each run with a new personal best waited the whole time while holding its map's row and one of the request pool's ten connections. Enough runs arriving then would take every connection, and the whole site would stall until the recount finished. The ingest now waits at most 2 s for the lock (`lock_timeout`, for the rest of its transaction). Past that the run is rolled back and the server gets a 500, which plugins treat as temporary: they keep the run queued and send it again, and the ingest's idempotency stores and counts it once. Other recounts (tiers, bans, invalidation, the full recount itself) still wait as before.
Refuse runs that finished before their ruleset or server existed
Stop a run being stored from waiting behind a full recount
Check out every text file with LF line endings
Build the site in CI, and read live data at request time
Improve maps pages and map summaries
|
Merged into |
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.
Syncs the current canonical SourceJump changes into this preview branch, including map link-card generation, the ingest recount-lock timeout, finish-time validation, LF line endings and request-time data loading.
Preserves the approved frontend byte-for-byte except generated API types and the upstream connection() guards in the home, totals and server data loaders. Existing sign-in fixes and server-key checks remain intact. Preview workflows are unchanged so the preview intake can merge this normally.
The already-applied local migrations 0052-0054 are unchanged. The tier view already exists as 0054; upstream's map-card migration follows as 0055. The WR-holder search fixture inherits its ruleset's publication time to remain valid under the upstream ingest checks.
Validation: offline API build, Clippy, 36 map tests (the updated ruleset fixture passed its focused rerun), three standings-lock tests, finish-time validation, 118 web unit tests with one existing skip, web lint, 18 browser/style-guide tests and a production web build with the API deliberately unreachable. No database reseeding or frontend redesign.