Skip to content

perf(frontend): add stable pagination and snapshot behavior to transfer history - #297

Open
woahwhattheheck wants to merge 4 commits into
RemitFlow:mainfrom
woahwhattheheck:goat/remitflow-278-transfer-pagination
Open

woahwhattheheck wants to merge 4 commits into
RemitFlow:mainfrom
woahwhattheheck:goat/remitflow-278-transfer-pagination

Conversation

@woahwhattheheck

Copy link
Copy Markdown

Closes #278

Summary

Transfer history paging now uses a filter-scoped snapshot with cursor tie-breakers so new transfers arriving mid-scroll cannot duplicate or omit rows. Filter changes reset the snapshot; expired cursors recover cleanly.

What changed

  • transferSnapshot builds a frozen membership list sorted by createdAt desc with id as the stable tie-breaker, encodes scoped cursors, and recovers when a cursor is expired or out of scope.
  • Transfers pages against the snapshot instead of a live offset slice. Concurrent inserts stay off the current pages until filters reset or the snapshot TTL elapses.
  • Empty snapshots created while the list is still loading are rebuilt once rows arrive (so first paint is not frozen empty).

Tradeoffs

  • Snapshot TTL is five minutes — long enough for a paging session, short enough that a stale view does not linger forever.
  • Pull-to-refresh updates live record fields for snapshotted ids but does not reshuffle membership mid-page; that is intentional.

Compatibility

  • UI-only change to pagination mechanics; filter URL sync and selection toolbar behavior are preserved.
  • Existing filter / select-all suites remain green.

Test evidence

npx vitest run \
  test/unit/transfer-snapshot.test.js \
  test/integration/transfers-snapshot-pagination.test.jsx \
  test/integration/transfers-filter.test.jsx \
  test/integration/select-all-across-pages.test.jsx
# Test Files  4 passed | Tests  20 passed

Coverage includes concurrent-insert stability, cursor expiry recovery, filter-reset, and a 50-row fixture without gaps.

Out of scope

  • Broad rewrites, unrelated services, or cosmetic-only changes.

Ready for review

Replace offset paging with a filter-scoped snapshot so concurrent inserts
cannot duplicate or omit rows mid-scroll. Cursors carry a stable
(createdAt, id) tie-breaker; filter changes mint a new snapshot; expired
cursors recover by rebuilding from the live list.

Closes RemitFlow#278
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.

perf(frontend): add stable pagination and snapshot behavior to transfer history

1 participant