Skip to content

fix: ensure onCancelled callback is properly invoked#375

Merged
w1am merged 1 commit intotrunkfrom
w1am/listener-on-cancelled-callback-not-being-invoked
Feb 26, 2026
Merged

fix: ensure onCancelled callback is properly invoked#375
w1am merged 1 commit intotrunkfrom
w1am/listener-on-cancelled-callback-not-being-invoked

Conversation

@w1am
Copy link
Contributor

@w1am w1am commented Feb 26, 2026

Fix: #373

The onCancelled callback was not being called when a subscription was stopped by the user or when the onEvent handler threw an exception. This fixes both cases by propagating cancellation through the consumer and catching handler exceptions in ReadResponseObserver.

Also reorders onSubscriptionConfirmation to complete the future before calling the listener.

The onCancelled callback was not being called when a subscription was
stopped by the user or when the onEvent handler threw an exception.
This fixes both cases by propagating cancellation through the consumer
and catching handler exceptions in ReadResponseObserver.

Also reorders onSubscriptionConfirmation to complete the future before
calling the listener, preventing race conditions.
@w1am w1am merged commit d69f41c into trunk Feb 26, 2026
78 of 83 checks passed
@w1am w1am deleted the w1am/listener-on-cancelled-callback-not-being-invoked branch February 26, 2026 09:25
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@w1am 👉 Created pull request targeting release/v1.1: #376

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Listener onCancelled callback not being invoked in catch-up subscriptions

1 participant