Skip to content

Conversation

@mdkitzman
Copy link
Contributor

This PR

Fixing an issue with the MultiProvider where hook contexts and hints were being lost due to copies of the context data being created in the OpenFeature sdk evaluation.

Since key evaluation of Maps using objects is done by reference, the lookup of the context during evaluation was failing, leading to errors.

  • adds this new feature

Related Issues

Fixes #1268

Notes

Follow-up Tasks

How to test

Fixing an issue with the MultiProvider where hook contexts and hints
were being lost due to copies of the context data being created in the
OpenFeature sdk evaluation.

Since key evaluation of Maps using objects is done by reference, the
lookup of the context during evaluation was failing, leading to errors.

Signed-off-by: Mike Kitzman <mdkitzman@gmail.com>
@mdkitzman mdkitzman marked this pull request as ready for review November 14, 2025 15:08
@mdkitzman mdkitzman requested review from a team as code owners November 14, 2025 15:08
Copy link
Member

@beeme1mr beeme1mr left a comment

Choose a reason for hiding this comment

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

Could a test be added to verify the issue has been resolved?

@mdkitzman
Copy link
Contributor Author

Could a test be added to verify the issue has been resolved?

Yeah, let me take a look at adding a test for this.

Copy link
Member

@lukas-reining lukas-reining left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @mdkitzman!
I see one possible issue.

When accumulating the context in the OpenFeature client in the before
hooks, the context was being re-assigned instead of merged. This change
ensures that the context is merged correctly, preserving object
reference.

Signed-off-by: Mike Kitzman <mdkitzman@gmail.com>
Copy link
Member

@jonathannorris jonathannorris left a comment

Choose a reason for hiding this comment

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

This looks like the correct fix to me, assigning the existing object and not creating a new one makes sense.

Copy link
Member

@beeme1mr beeme1mr left a comment

Choose a reason for hiding this comment

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

Thanks!

@beeme1mr beeme1mr requested a review from toddbaert November 19, 2025 21:28
@beeme1mr beeme1mr added this pull request to the merge queue Nov 19, 2025
Merged via the queue into open-feature:main with commit 2f9e0d3 Nov 19, 2025
10 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.

[BUG] Multi Provider: hookContexts.get(context) fails, but works with context.context

4 participants