-
Notifications
You must be signed in to change notification settings - Fork 64
fix(openfeature): address RUM context review feedback #1428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
greghuels
merged 11 commits into
develop
from
greg.huels/FFL-3312/flag-context-enrichment-followup
Sep 21, 2026
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
fb00ecd
refactor(flags): remove RUM context enricher export alias
greghuels 1e9b39e
fix(flags): isolate custom-property and identity-field read failures
greghuels 8464aa8
fix(openfeature): accept undefined RUM context attributes
greghuels 5b34621
fix(openfeature): degrade gracefully when RUM enrichment is unavailable
greghuels fd0194b
docs(openfeature): clarify RUM context setup and isolation
greghuels bb8e2ea
fix(flags): preserve null RUM context attributes
greghuels 3bb065f
refactor(openfeature): rename helper to enrichWithRumUser
greghuels 960901a
FFL-3312: Defer null RUM attribute enrichment
greghuels f470ad7
fix(openfeature): address RUM enrichment review findings [FFL-3312]
greghuels 58296e9
fix(openfeature): separate context merging from validation [FFL-3312]
greghuels f89be25
fix(openfeature): shorten RUM compatibility warning [FFL-3312]
greghuels File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤖 Comment from Claude working with Aaron Silverman:
[P3]
nullandundefinedare interchangeable here but not downstream — an application that writestargetingKey: nullinstead ofundefinedcan get a different offline outcome.toDdContextmaps both to''via?? ''. ButisEmptyContext(mappers.ts:45-47) testsvalue === undefined, and the offline provider branches on that before mapping. So the two diverge.Executed — through the real offline provider, against a
user-123snapshotundefinedis treated as "no override" and re-adopts the embedded context;nullis treated as a real context, gets mapped to the anonymous subject, and fails to match.The divergence is conditional, because
isEmptyContextinspects every value: it only appears when the rest of the context is empty. Adding one ordinary attribute collapses it, and against an anonymous snapshot both succeed:So: same intent, different result in the narrow case, and nothing documents it.
This is the concrete reason the
nullrow in thisit.eachis worth a second look: it is not simply "another non-string".nullis the one value the two layers disagree about.Scope
For this warning specifically, the nullish rows are unreachable from either provider —
toDdContextapplies?? ''first, so neithernullnorundefinedarrives here.42,trueandfalsedo reach it, andrumContext.integration.test.ts:184already asserts that. So the rows are not dead as a group; the two nullish ones are documentation for directDdFlagscallers.For reference — what the browser SDK does with
nullPinned to local commit
cb896583, because upstream has since moved (the provider now enriches context with RUM user defaults by default, and the line numbers below have shifted):targetingKey: nullfetchConfiguration.ts:79,|| '')''exposureEvent.ts:20,= '')null— the default only applies toundefinedflagEvaluationAggregator.ts:106,|| '')''So the browser SDK is inconsistent about
nulltoo, in its own way: the wire treats it as anonymous while the exposure event lets it through tosubject.id. Neither SDK has a stated position. Worth one, if these are ever reconciled.Suggested change — a note here; the divergence itself is a separate call
Whether
isEmptyContextshould also treatnullas absent is a real decision and bigger than this PR; I would rather flag it than smuggle it in. If you want it tracked, it is a one-line change with an offline test.