Skip to content

[BUG] inconsitent behaviour in server side hookcontext data for evaluation context #1236

@aepfli

Description

@aepfli

Observed behavior

take a close look at the code, comparing java and js there is a difference in how the hookcontext is build/enriched with evalutation context.

js-code: https://github.com/open-feature/js-sdk/blob/main/packages/server/src/client/internal/open-feature-client.ts#L255-L327

java-code: https://github.com/open-feature/java-sdk/blob/a08ff4d96ccf9236ad882892280b600a05409394/src/main/java/dev/openfeature/sdk/OpenFeatureClient.java#L160-L231

In java the evaluation context is everytime updated, when it was changed (due to hooks, etc). in js it is only set a the beginning with the merged context, but does not update with the frozenContext from the beforehooks.

This leads to the problem that in the after, finally and error hooks the information in the hookcontext is not up to date.

Expected Behavior

We should solve this in a way that this is backwards compatible and we always have the full context available

Steps to reproduce

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingquestionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions