Closed toddbaert closed 2 years ago
I dislike a custom merge function but we can add one later if we need to. This works for me.
Before Hook generated context will sit between invocation and client context.
Before Hook generated context will sit between invocation and client context.
I think that's a good point, and I agree with that precedence.
Resolved by:
Similarly to hooks, I think we want to allow setting global, client, and evaluation context. We will also need to describe how they are merged. This should be a fairly minor change to the spec, unless we want to get fancy with how to merge the contexts. We can mention it in the Evaluation Context spec, and link to the new requirements in the Flag Evaluation spec.
I'm proposing a simple merge where the invocation context overwrites properties in the client context, which overwrites properties in the global context:
Another option would be to define a merge function so that app-authors could have full control of how the merge works, perhaps with the above as a default.