Skip to content

Transaction context should be merged into the evaluation context of the hooks #521

@kouk

Description

@kouk

Hi,
During flag evaluation the transaction context is merged into the evaluation context here:

merged_context = self._before_hooks_and_merge_context(

However the hook_context.evaluation_context is created before this, so it doesn't contain the attributes or targeting key that exists in the propagated transaction context. This is unexpected. I believe that the _before_hooks_and_merge_context should be called inside _establish_hooks_and_provider so that the evaluation_context field in the hook_context can be up to date with all the attributes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions