fix(multi): forward ConfigurationChanged events from child providers#480
fix(multi): forward ConfigurationChanged events from child providers#480sahidvelji merged 1 commit intomainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses critical issues within the multi-provider's event handling mechanism, specifically concerning ConfigurationChanged events. It ensures that these events are correctly forwarded to the outbound channel and prevents unintended corruption of child provider states. The changes streamline event processing by bypassing state update logic for configuration changes, leading to more robust and predictable behavior. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
bc4c1ef to
18ff714
Compare
There was a problem hiding this comment.
Code Review
This pull request correctly fixes an issue where ConfigurationChanged events were being dropped and causing state corruption in the multi-provider. The approach of treating these events as a direct pass-through is sound and aligns with implementations in other OpenFeature SDKs. The code changes are clean and the removals of the old logic are appropriate. However, the new tests introduced to verify this fix have some flaws in their asynchronous event handling. They don't reliably account for events generated during initialization, which can lead to incorrect or flaky test results. I've added specific comments with suggestions to make the tests more robust.
18ff714 to
84a7193
Compare
84a7193 to
a0d5782
Compare
There was a problem hiding this comment.
Pull request overview
Fixes multi-provider event forwarding so ConfigurationChanged (ProviderConfigChange) events are no longer dropped and no longer corrupt child provider tracked state.
Changes:
- Forward
ProviderConfigChangeevents as pass-throughs (bypassing aggregate-state update logic). - Remove the dead pseudo-state mapping used for config-change events.
- Add tests validating forwarding behavior and ensuring provider/aggregate state is unaffected.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| openfeature/multi/multiprovider.go | Forwards config-change events directly and removes config-change state mapping. |
| openfeature/multi/multiprovider_test.go | Adds regression tests for config-change forwarding and state integrity. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Norris <jonathan.norris@dynatrace.com>
a0d5782 to
52e174e
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #480 +/- ##
==========================================
+ Coverage 83.21% 83.45% +0.23%
==========================================
Files 27 27
Lines 2109 2109
==========================================
+ Hits 1755 1760 +5
+ Misses 305 301 -4
+ Partials 49 48 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
ConfigurationChangedevents being silently dropped by the multi-provider's event forwarding pipelineConfigurationChangedeventCloses #479
Problem
The multi-provider's
forwardProviderEventsonly forwarded events to the outbound channel whenupdateProviderStateFromEventreturnedtrue(i.e., when the aggregate state changed). SinceConfigurationChangedwas mapped to an empty-string pseudo-state with weight-1, it could never change the aggregate — so these events were always dropped.As a side effect, the emitting provider's tracked state was set to
"", making it invisible to futureevaluateStatecalls until it emitted another real state event.Fix
ConfigurationChangedevents are now forwarded directly as a pass-through inforwardProviderEvents, bypassing the state update logic entirely. This matches the JS SDK reference implementation whereConfigurationChangedis re-emitted on the multi-provider's event emitter without going through status change logic.The now-dead empty-string state mapping (
"": -1instateValues,ProviderConfigChange: ""ineventTypeToState) has been removed.