Skip to content

Add cursor-based pagination to recentLedger and wallet queries - #11

Merged
Neziahtech merged 1 commit into
Neziahtech:mainfrom
MrNova50:freebuff/problem-a-minted-receipt-stays-pendi-kn8e6vvq
Sep 11, 2026
Merged

Neziahtech merged 1 commit into
Neziahtech:mainfrom
MrNova50:freebuff/problem-a-minted-receipt-stays-pendi-kn8e6vvq

Conversation

@MrNova50

Copy link
Copy Markdown
Contributor

closes #2

PR Description:

Problem
recentLedger and the wallet query in src/convex/nexis.ts truncate to the latest ~100 and ~200 entries respectively. As soon as a team actually uses the ledger, older entries silently drop out of view — undermining the auditability this project exists to provide.

Changes

  • Replaced the fixed .take(100) / .take(200) caps with cursor-based pagination on both recentLedger and the wallet query, using Convex's paginationOpts pattern.
  • Sort order kept as _creationTime then _id as tiebreaker — stable and gapless, so new inserts don't reshuffle already-fetched pages.
  • Added a "Load more" control on the dashboard ledger that fetches and appends subsequent pages.
  • Added a full-history paginated view per handle on the public proof page, using the same underlying query.
  • Balance computation untouched — out of scope, tracked separately.

Testing

  • Seeded 250+ ledger entries and paged forward to entry zero with no gaps or duplicates across page boundaries.
  • Verified sort stability under concurrent inserts during active pagination.
  • Confirmed both dashboard and public proof page load incrementally without regressing small-ledger behavior.

@Neziahtech
Neziahtech merged commit 146dfc2 into Neziahtech:main Sep 11, 2026
1 check 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.

Ledger pagination: the audit view silently truncates history

2 participants