Skip to content

feat(listeners): implement idempotent restart from persisted cursor#608

Merged
Baskarayelu merged 1 commit into
CredenceOrg:mainfrom
afeezorobsco-cyber:afeez/ledger-restart
Jun 27, 2026
Merged

feat(listeners): implement idempotent restart from persisted cursor#608
Baskarayelu merged 1 commit into
CredenceOrg:mainfrom
afeezorobsco-cyber:afeez/ledger-restart

Conversation

@afeezorobsco-cyber

Copy link
Copy Markdown
Contributor

##close #575

Description

This PR implements idempotent restart behavior for the Horizon Bond Creation listener by restoring the last persisted cursor on startup instead of always starting from now.

On startup, the listener loads the saved paging_token from the existing horizon_cursors table using CursorRepository. If no checkpoint exists or the lookup fails, it safely falls back to now, preserving the existing cold-start behavior.

Changes

  • Restore the persisted cursor before opening the Horizon stream
  • Fall back to now when no checkpoint exists or the lookup fails
  • Add unit tests covering resume, missing checkpoint, and database failure scenarios
  • Update the Horizon listener documentation

This implementation is additive, introduces no schema or configuration changes, and aligns the bond creation listener with the existing restart behavior used by the other Horizon listeners.

Closes #

@drips-wave

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

@afeezorobsco-cyber 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

@Baskarayelu

Copy link
Copy Markdown
Contributor

implement idempotent restart from persisted cursor — clean work, in it goes 🚀

@Baskarayelu Baskarayelu merged commit 69cc993 into CredenceOrg:main Jun 27, 2026
0 of 2 checks 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.

Add backfill job with cursor checkpointing

2 participants