Skip to content

cms: the inbox in pages of 50, one statement query, Proposal indexes, photo rollback - #28

Merged
Lindeneg merged 4 commits into
masterfrom
LTET-18-inbox-pages
Nov 7, 2026
Merged

Lindeneg merged 4 commits into
masterfrom
LTET-18-inbox-pages

Conversation

@Lindeneg

@Lindeneg Lindeneg commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Closes LTET-18

Changed

  • The inbox pages 50 at a time, newest first, with Newer and Older links like the runs list (?page=n beside kind and status). A bad or out-of-range page is a 404 "Page not found", as on the runs list. The kind chips count across every page.
  • A decision posts its page back and returns to it, or to the last page when the page emptied. A failed decision re-renders its page, clamped the same way.
  • The inbox fetches the disputes' statements in one id IN (...) query, without their history, and skips the query when a page has no disputes.
  • The run report's "In the inbox" link carries &page=n when the proposal sits past the first page.
  • A migration adds indexes on Proposal.runId and Proposal.statementId (indexes only, no data change).
  • A failed contender update puts the previous photo back, or removes the new one when there was none. A photo that can't be read first stops the update before anything is written.

Tested

  • Unit: proposal service (zero, 50, 51, out of range, clamp, one statement query, removed statement, failures), inbox router (page param, bad pages, pager, decisions returning to their page or the one before, failed decision clamped), inbox and run views (counts across pages, pager ends, hidden page field, run link at 49 and 50 newer), content service (photo replaced, added, removed and unchanged when the update fails, the row gone by the update, an unreadable photo).
  • E2E: 51 suggestions page across two pages and a page past the last is a 404; a run's proposal behind 50 newer ones is linked to, and shown on, its page.
  • npm run build, npm run test:unit, npm run test:e2e, npx prettier --check . pass on the head.

Look at first

  • src/services/content-service.ts updateContender: the order of read, write, update and rollback.
  • The migration in prisma/migrations/20261107000300_proposal_indexes.

@claude

claude Bot commented Nov 7, 2026

Copy link
Copy Markdown

review: a737707
no findings

@Lindeneg
Lindeneg merged commit 1382104 into master Nov 7, 2026
4 checks passed
@Lindeneg
Lindeneg deleted the LTET-18-inbox-pages branch November 7, 2026 00:19
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