Skip to content

fix: add themed error and 404 pages, scope JSON-LD Event properties, enforce the verification window - #279

Merged
AnayDhawan merged 1 commit into
StudentSuite:mainfrom
propcgamer20-png:fix/error-pages-jsonld-verification-expiry
Oct 21, 2026
Merged

AnayDhawan merged 1 commit into
StudentSuite:mainfrom
propcgamer20-png:fix/error-pages-jsonld-verification-expiry

Conversation

@propcgamer20-png

Copy link
Copy Markdown
Contributor

Summary

Three bug fixes, one PR:

  • bug: no app/error.tsx or not-found.tsx — errors and 404s fall back to Next's default pages #255 error and 404 pages. New src/app/not-found.tsx (a themed 404 with links back to the map, competitions and home; it covers unknown routes and the notFound() calls for an unknown city or competition) and src/app/error.tsx (a themed error screen with a "Try again" button that calls reset(), the digest as a reference if there is one, and a link home; the error message itself is not shown to visitors). The three /docs/awesome-* pages now catch a failed fetchAwesomeList() and show a new AwesomeListUnavailable message with a link to the list on GitHub instead of crashing.
  • bug: competitionJsonLd() emits an Event-only eventAttendanceMode on scholarship records #256 JSON-LD. competitionJsonLd() now writes eventAttendanceMode, startDate and endDate only when the node's @type is Event, so a scholarship (EducationalOccupationalProgram) no longer carries Event-only properties.
  • bug: verification badge never expires — the documented 12/6-month window is never checked #251 verification expiry. The 12 month (places) and 6 month (exam centres and competitions) windows from data/CONTRIBUTING.md are now enforced in two places that share one module (scripts/lib/verification-window.mjs, with a typed wrapper in src/lib/verification.ts): VerifiedBadge stops rendering once the verification has passed its window, and scripts/check-data-freshness.mjs reports an error for any record whose verified.on is past its window, the same way it already does for valid_till. A verified.on that isn't a real date is also reported. Nothing in the current data is stale.

Closes #255, closes #256, closes #251.

Things to know

  • The existing "shows a badge for verified places" test in results-list.test.tsx used a fixed verification date and the real clock, so it would have started failing a year from now. It now runs on a fixed date.
  • On the awesome-list pages, a failure shows the message but the page is cached by ISR like any other render, so it can stay up for up to the 24 hour revalidate window. The alternative is to let the error throw, which keeps the last good version but crashes the page on first build or deploy. Say if you prefer that.
  • check-data-freshness.mjs already fails today on the 12 records whose cycle or last date has passed (the freshness issue Data freshness check failed #276), so the new check does not change the current pass or fail state.

How I checked

npm run typecheck, npm run lint, npm run format:check, npm run test:unit (505 pass) and npm run build pass. With the production build running, an unknown route and /competitions/not-a-real-competition both return 404 with the new page, and /docs/awesome-study-resources returns 200.

New tests: the window lengths per type, expiry on and after the boundary day, month-end clamping (31 August plus six months, and 29 February), an unreadable date counting as expired, the badge hidden for an old library and an old exam centre, the freshness script (6 and 12 month windows, type from the file name, bad date), JSON-LD for scholarships and for every category, the two new pages, and the three awesome-list pages with a failing fetch.

@vercel

vercel Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

@propcgamer20-png is attempting to deploy a commit to the studentsuite Team on Vercel.

A member of the Team first needs to authorize it.

@propcgamer20-png
propcgamer20-png force-pushed the fix/error-pages-jsonld-verification-expiry branch from 0c1f969 to 4b45b18 Compare October 21, 2026 13:32
@AnayDhawan
AnayDhawan merged commit 3103e27 into StudentSuite:main Oct 21, 2026
4 of 5 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

2 participants