Skip to content

Fix event poll cursor for multi-page ledgers - #422

Open
TheFaith-Code wants to merge 1 commit into
conduit-protocol:mainfrom
TheFaith-Code:fix/185-event-poller-cursor
Open

Fix event poll cursor for multi-page ledgers#422
TheFaith-Code wants to merge 1 commit into
conduit-protocol:mainfrom
TheFaith-Code:fix/185-event-poller-cursor

Conversation

@TheFaith-Code

Copy link
Copy Markdown

This PR fixes a silent event-loss bug in the event poller used by subscribeToStream.

Summary
switch event polling to use the RPC pagination cursor returned by getEvents
stop deriving the next poll position from the highest ledger in the current page, which could skip remaining events from the same ledger when a page boundary is hit
fall back to latestLedger + 1 when no cursor is returned, so already-seen events are not replayed
add a regression test covering a ledger with more than 100 events across multiple pages to confirm all events are delivered
Testing
npm test -- --run src/tests/events-subscribe.test.ts
Closes #185

@drips-wave

drips-wave Bot commented Jul 31, 2026

Copy link
Copy Markdown

@TheFaith-Code Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Bug: event-poller cursor can silently drop events when a ledger exceeds one page

1 participant