Kataba's own 404 page, with a real 404 status for guests (#80) #81
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MassiveDynamic/kataba!81
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/80-not-found"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #80
Summary
kataba's own 404 page replaces Next.js's: a big "404" whose zero is the kataba mark, hopping on its shadow (still with reduced motion), a short playful text and a link back to the start page. It has a tab title and German translations.
Missing content answered 200 everywhere: with Cache Components the prerendered shell goes out before a page's
notFound(). Guests now get a real 404 from a proxy (ADR-0017):hiddenFromGuestcovers top-level page slugs,/c/…,/guides/…(reading, edit, new) and/admin/…. It reads straight from the database (only the columns visibility needs), because neither"use cache"norauth()runs in the proxy. A top-level name is a page slug unless it is inAPP_ROUTE_NAMES, which a test keeps exactly in step withsrc/app. If the check fails, the page decides.Evidence
curl /typo /login /c/x /guides/x /admin/settings→200 200 200 200 200After (guest, GET and HEAD): →
404 404 404 404 404;/,/search,/icon.svg→200; with a session cookie →200(unchanged)e2e/notFound.spec.ts: an unknown address shows the kataba 404 page and leads home; a guest gets status 404 for a mistyped slug,/login,/guides,/c/…,/guides/…,/guides/newand/admin/settings. Inaccess.specandpages.spec, a guest on a hidden guide, a draft page or an internal page now also gets 404. Inauthoring.specandpages.spec, a guest gets 200 for a published category, guide and page.Merge Danger
Door: two-way
Revert the commits and it's back to before. No data or schema changes.
Blast Radius: routing
The proxy runs on every page load. If
hiddenFromGuestever disagreed with a page's own check, a guest would see the 404 page for content they may read. The 200 assertions and the guest reads in the e2e suite would catch that. A database error in the check leaves the address to the page; it no longer turns into a 500. When a route's check changes,hiddenFromGuesthas to change with it. Signed-in visitors still get status 200 on not-found. Guest page loads of content cost one or two extra DB reads.🤖 Generated with Claude Code