fix(openfeature): treat empty contexts literally (FFL-2837) - #1359
Merged
btthomas merged 3 commits intoAug 7, 2026
Merged
Conversation
btthomas
marked this pull request as ready for review
August 7, 2026 00:50
btthomas
requested review from
dd-oleksii and
pavlokhrebto
and removed request for
a team
August 7, 2026 00:50
9 tasks
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.
PR stack
Summary
This PR makes an empty OpenFeature context a real evaluation context. It does not use an empty context as a request to restore the context in a precomputed configuration.
This PR also exports getPrecomputedContext(configuration). The function returns a detached copy of the context in a valid precomputed branch. It returns undefined when the configuration has no context-specific precomputed branch. The function does not change OpenFeature or provider state.
The provider now preserves the difference between a missing targeting key and an empty targeting key. The online provider behavior does not change.
Reason
OpenFeature gives a provider the effective context. It uses an empty object when the global context is unset or cleared. The provider cannot determine which OpenFeature operation produced that object.
The old implementation treated the empty object as an internal reset command. This behavior did not match the browser SDK. It also made setContext({}) and clearContext() restore private configuration state.
Applications can now use the public helper to set the matching context explicitly before provider registration. Applications do not need to inspect the configuration wire or parsed object.
User impact
Upstream follow-up
Validation
The example-app lint command could not start because the current dependency installation does not contain the jest/globals ESLint environment. The changed package source passed lint, and both package builds passed.