Skip to content

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

Merged
Jaydbrown merged 1 commit into
conduit-protocol:mainfrom
TheFaith-Code:fix/185-event-poller-cursor
Aug 26, 2026
Merged

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

Conversation

@TheFaith-Code

Copy link
Copy Markdown
Contributor

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

@Jaydbrown

Copy link
Copy Markdown
Contributor

Thanks for the contribution here — squash-merging this now. Any follow-ups we'll track in a fresh issue. 🚀

@Jaydbrown
Jaydbrown merged commit 31ec5c9 into conduit-protocol:main Aug 26, 2026
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

2 participants