Repository navigation
fix(subscriptions): stop an acknowledgement from before a disconnect covering events the subscriber has not processed - #72
Conversation
PR SummaryMedium Risk Overview Subscriber tracking now keeps a The subscription FSM no longer ignores acks in states where they previously no-oped; it applies Integration tests cover multi-subscriber reconnect scenarios; unit tests cover multi-reset ack ordering. Reviewed by Cursor Bugbot for commit bfd8e3f. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Superseded delivery tracking lib/event_store/subscriptions/subscriber.ex, test/subscriptions/subscriber_test.exs |
Subscriber state retains in-flight events cleared by resets. Acknowledgements check superseded deliveries before current in-flight events. Unit tests cover repeated resets, acknowledgements, and discards. |
FSM acknowledgement integration lib/event_store/subscriptions/subscription_fsm.ex, test/subscriptions/subscription_locking_test.exs |
The fallback acknowledgement clause discards superseded deliveries for known subscribers. Locking tests cover acknowledgements before and during disconnects, then after redelivery. Test helpers support subscriber setup and state checks. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Possibly related issues
- With concurrency_limit above 1, a late cumulative ack can checkpoint past an unprocessed event #44: The issue concerns processing events sent before fencing. This change addresses acknowledgement boundaries for earlier deliveries around disconnects and redelivery.
- Cluster.md and Architecture.md describe fenced node behaviour differently from the runs #46: The issue concerns in-flight events when a node is fenced. This change distinguishes superseded deliveries from current in-flight events during acknowledgement.
Possibly related PRs
- TrogonStack/commanded_eventstore#27: That PR changes when a subscription learns that its advisory lock is lost. This change handles acknowledgements that arrive across the resulting disconnect and redelivery.
Suggested reviewers: slashdotdash, vheathen
Merge Risk: 
Minimal · up to bfd8e
-
The PR is mergeable; no actionable regression was identified in the reviewed changes.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed -
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit counts each event twice,
Old trails fade as new ones rise.
Acks find the delivery they knew,
While fresh events wait their turn too.
Hops resume when streams renew.
Comment @coderabbitai help to get the list of available commands.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2b2a460. Configure here.
2b2a460 to
0a631c9
Compare
0a631c9 to
630ac62
Compare
37a08b9 to
97f21ff
Compare
97f21ff to
8f5a1a3
Compare
… covering events redelivered after it Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
…covering events the subscriber has not processed Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
8f5a1a3 to
4fa06ef
Compare
…allow acknowledgements of events sent again Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>

Uh oh!
There was an error while loading. Please reload this page.