Closed james-milligan closed 1 year ago
@beeme1mr @toddbaert @skyerus @justinabrahms @thomaspoignant
I fully agree with the problem statement. I think we're leaking things to providers that we shouldn't (hooks, hookhints).
As for the solution, I would be open to either passing only providerHints
as you suggest, or simply removing this argument entirely in the FeatureProvider
interface (we may be solving problems we don't yet have).
Let's allow others to weight in.
My preference would be to remove the argument entirely if the provider has no need for it to avoid any future confusion.
We could just rename hookHints
to something more general, and then pass this bucket object to both hooks and providers as a way to supply arbitrary data to both. I'm still open to any of the above.
I vote to remove the argument. If a provider wants access to it, they can do that via provider hooks.
I vote to remove the argument. If a provider wants access to it, they can do that via provider hooks.
I completely agree and was just about to write the same thing. Simply removing the options arguments from the resolvers would make the separation more clear.
@james-milligan, could you please open a PR for this?
Yup totally agree with the problem statement. That's a +1 vote for me.
The
Evaluation Options
structure is currently a little confusing when implementing a provider.Currently the structure is as follows (taken from the golang-sdk, but mirrored in other languages):
This structure is currently being passed from the
Client
to theFeatureProvider
, this is intentional as thehookHints
may be used to alter the behaviour of the given provider, such as mutating the resulting flag value before it is passed back into the client. However, theFeatureProvider
should not be altering the existinghooks
, nor should it be calling their respective methods, so passing thehooks
/hookHints
as an argument may be a little confusing and breaks the separation of interest between theClient
andFeatureProvider
.I propose that either an additional field should be added to the
Evaluation Options
structure, such asproviderHints
for use in theFeatureProvider
, or for a similar structure to be passed to the provider directly to reduce confusion.Personally I think that only passing relevant information to the
FeatureProvider
would be favourable in this situation, especially if theEvaluationOptions
has the possibility of becoming bloated withhooks
/hookHints
that should not be used downstream from theClient