Skip to content

fix(sports): cap /sports/all pages, admin-only layout delete, parallel standings + schedule - #169

Merged
RonanHevenor merged 1 commit into
mainfrom
fix/sports-audit
Oct 25, 2026
Merged

RonanHevenor merged 1 commit into
mainfrom
fix/sports-audit

Conversation

@RonanHevenor

Copy link
Copy Markdown
Member

Follow-ups from an audit of the sports section merge (151e52c..1711904).

Changes

  • /sports/all page cap. Any ?page= above 1000 now returns a 404 before querying. Previously ?page=1e20 passed an offset past Postgres's bigint range and the request returned a 500.
  • Sports Layout delete is admin-only. The collection had no delete rule, so Payload's default let any logged-in user delete it.
  • Standings and score strip load in parallel on /sports. The schedule used to wait for the standings because the strip follows the standings card's sports.
    • It is now fetched for every standings sport at the same time, then narrowed to the card's sports in the card's order.
    • Worst case on a cold cache (first visit after a deploy, or a slow upstream) drops from about 24s to about 16s.
    • Trade-off: the older-months lookback now runs on almost every cold fetch, because some standings sport is always out of season. That's a few extra requests to rpiathletics.com, cached for an hour.
    • Turning the strip off still means RPI Athletics isn't contacted.

No schema changes and no migrations.

Checks

  • pnpm typecheck: passes
  • pnpm lint: no errors, and no warnings in the changed files
  • Not exercised in a browser

🤖 Generated with Claude Code

…tandings and schedule together

- /sports/all returns 404 past page 1000 instead of passing a huge offset
  to Postgres
- Sports Layout can only be deleted by admins (it had no delete rule, so
  any logged-in user could)
- /sports fetches standings and the score-strip schedule in parallel; the
  schedule covers every standings sport and is narrowed to the card's
  sports afterwards, so a slow feed costs one wait instead of two

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@RonanHevenor
RonanHevenor merged commit 934294d into main Oct 25, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant