Repository navigation
fix: honor user replaced by local before hooks - #126
Merged
Merged
Conversation
JamieSinn
approved these changes
Nov 16, 2026
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.
The local client accepts a replacement context from a before hook, but evaluates the variable using the original user. Consequently, targeting ignores user attributes supplied through the replacement context, while subsequent hooks receive that replacement user.
Use
context.userfor local bucketing, matching the cloud client. Add a regression test using the existing configuration fixture and real WASM engine: replacing the user with one whose email targets the off variation must changevariationOntovariationOff, without mutating the original user.Testing and validation
python -m unittest test.test_local_client.DevCycleLocalClientTest.test_before_hook_replaces_user: fails on main withvariationOninstead ofvariationOff; passes with the fix.AI assistance was used to prepare this change and its regression test.