We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When writing a provider for the web-sdk, you can emit events and it is possible to provide EventDetails with the event.
EventDetails
const events = new OpenFeatureEventEmitter(); events.emit(ProviderEvents.Error, { clientName: 'my-client-name', message: 'your message here' });
When reading the event, from the handler we can see that the value of the client name is not what was provided in the event.
await OpenFeature.setContext(defaultContext); OpenFeature.setProvider('test-provider', defaultProvider); const client = await OpenFeature.getClient('test-provider'); client.addHandler(ProviderEvents.Error, (event) => console.log(event)); // Result: //{ // clientName: 'test-provider', // message: 'Request failed with status code 404' //}
The value of clientName is the client's name set in setProvider or undefined if we have no name for the provider.
clientName
setProvider
undefined
Not sure exactly how it should work here, but I see 2 potential solutions:
emit
The text was updated successfully, but these errors were encountered:
Hey @thomaspoignant, I think option 1 makes the most sense. The actual behavior seems to work how I would expect.
I'll take a shot at addressing this.
Sorry, something went wrong.
Yes, I agree for me option 1 is probably the best one.
beeme1mr
Successfully merging a pull request may close this issue.
Observed behavior
When writing a provider for the web-sdk, you can emit events and it is possible to provide
EventDetails
with the event.When reading the event, from the handler we can see that the value of the client name is not what was provided in the event.
The value of
clientName
is the client's name set insetProvider
orundefined
if we have no name for the provider.Expected Behavior
Not sure exactly how it should work here, but I see 2 potential solutions:
clientName
to providers to avoid confusion for people writing providers.clientName
provided in theemit
function and forward it in the event.The text was updated successfully, but these errors were encountered: