trails/apps/journal/app/jobs
Ullrich Schäfer b20c8cca39 Cursor-based pagination for /notifications
Switches `listForUser` from page-offset to cursor (`before` param,
opaque base64 of `{ts, id}`) ordered by `(created_at DESC, id DESC)`
for stable pagination even with simultaneous fan-out inserts.

Returns `{ rows, nextCursor }` instead of a bare array. Loader surfaces
`?before=<cursor>` on a "Load older" link at the bottom of the list,
shown only while `nextCursor !== null`. Default page size 50, capped
at 100. Malformed cursors fall back to "start from top" rather than
400ing — opaque cursors should not be a client validation surface.

Spec drift: delta spec adds three pagination scenarios (cursor pages
forward, tie-stable on identical `created_at`, malformed-cursor
graceful fallback). Design doc gets a new decision section explaining
the cursor choice over page-offset and why we don't compute totals.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 01:42:32 +02:00
..
demo-bot-generate.ts Upgrade pg-boss from 10 to 12 2026-04-19 23:01:11 +02:00
demo-bot-prune.ts Upgrade pg-boss from 10 to 12 2026-04-19 23:01:11 +02:00
notifications-fanout.integration.test.ts Cursor-based pagination for /notifications 2026-04-26 01:42:32 +02:00
notifications-fanout.ts Implement notifications + supporting fixes 2026-04-26 01:28:55 +02:00
notifications-purge.ts Implement notifications + supporting fixes 2026-04-26 01:28:55 +02:00