Repository navigation
fix: Unsubscribe the provider's listeners on shutdown - #37
Merged
kinyoklion merged 3 commits intoOct 2, 2026
Merged
kinyoklion merged 3 commits into
kinyoklion merged 3 commits into
Conversation
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
|
@cursor review |
kinyoklion
marked this pull request as ready for review
September 29, 2026 22:44
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 e2f07de. Configure here.
A client which fails to initialize can still connect afterward, so the status and flag listeners are now registered regardless of the outcome. Signed-off-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
…-wait' into devin/1788360667-ruby-event-dedup Signed-off-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com> # Conflicts: # README.md # lib/ldclient-openfeature/impl/event_listeners.rb # lib/ldclient-openfeature/provider.rb
keelerm84
approved these changes
Sep 30, 2026
kinyoklion
merged commit Oct 2, 2026
c6e8ce6
into
devin/1788360613-ruby-zero-start-wait
6 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The provider's data source status and flag change listeners stayed registered on the LaunchDarkly client after
shutdown, so a provider which the OpenFeature SDK had already replaced could still emit events. They are now removed before the client is closed.Event deduplication and the events emitted after a failed initialization, which this PR previously carried, now live in #36 instead; this branch has been merged with that one and keeps only the
shutdownchange. Review #36 first.Found during the weekly OpenFeature provider audit.
Implementation details
Requirements
Related issues
None.
Describe the solution you've provided
The listeners the constructor registers are kept on the provider so that
shutdowncan pass them toremove_listeneron the data source status provider and the flag tracker before closing the client.Describe alternatives you've considered
Relying on
closealone: the LaunchDarkly client stops notifying listeners once it is closed, but the provider is the owner of those subscriptions and a closed client is not a guarantee the OpenFeature SDK makes about a replaced provider.Additional context
Testing:
bundle exec rspec(83 examples) andbundle exec rubocopon Ruby 3.4.5. Theshutdownspec now asserts both listeners are removed as well as the client being closed.Link to Devin session: https://app.devin.ai/sessions/fe1eb757fe694ef79f3d09f6307d4b47
Open in Devin Desktop: https://app.devin.ai/desktop/session/fe1eb757fe694ef79f3d09f6307d4b47?variant=devin
Requested by: @kinyoklion