Skip to content

api/src/db/remittanceStore.ts queryWithCursor does not handle concurrent inserts during pagination #720

@Haroldwonder

Description

@Haroldwonder

In api/src/db/remittanceStore.ts, the queryWithCursor method uses cursor-based pagination but does not account for new records being inserted between page requests. New remittances inserted between page 1 and page 2 fetches can cause records to appear on both pages or be skipped entirely.

File: api/src/db/remittanceStore.ts

Fix: Use a stable cursor based on a monotonically increasing ID or a snapshot timestamp to ensure consistent pagination across concurrent inserts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions