Skip to content

fix: honor user replaced by local before hooks - #126

Merged
JamieSinn merged 1 commit into
DevCycleHQ:mainfrom
pcbeingused333:fix/c3558-hook-user
Nov 16, 2026
Merged

JamieSinn merged 1 commit into
DevCycleHQ:mainfrom
pcbeingused333:fix/c3558-hook-user

Conversation

@pcbeingused333

Copy link
Copy Markdown
Contributor

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.user for 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 change variationOn to variationOff, without mutating the original user.

Testing and validation

python -m unittest test.test_local_client.DevCycleLocalClientTest.test_before_hook_replaces_user: fails on main with variationOn instead of variationOff; passes with the fix.

AI assistance was used to prepare this change and its regression test.

@pcbeingused333
pcbeingused333 requested a review from a team as a code owner November 15, 2026 23:52
dynatrace-llc-secret-protection[bot]

This comment was marked as low quality.

@JamieSinn
JamieSinn merged commit 12f032b into DevCycleHQ:main Nov 16, 2026
4 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.

2 participants