-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
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
[BUG] Web SDK hooks can return a promise? #630
Comments
Ya, and after having a look I also found that the "hook modified context" is not merged into the flag evaluation context, while it is in the server SDK. In the tests we have a test checking for |
I don't think it's valid that the before hooks in the client change the context in the client implementations. The static context should only be change via the |
Yes, that makes sense to me. Hooks should not be able to modify context in the client SDK. |
Ah yes totally missed that we specified this. The current type is: This is correct for the server SDK, for the client I would say it should be just void then: What do you think @beeme1mr @toddbaert? I could change this then. |
Yes, that looks how I would expect. |
@toddbaert I think this should also be under the condition that we are using dynamic context: |
Yes, I think you're right about that. |
@lukas-reining opened: open-feature/spec#217 |
<!-- Please use this template for your pull request. --> <!-- Please use the sections that you need and delete other sections --> ## This PR Fixes return type of hooks in client SDK. Maybe we should make this more clear in the spec @toddbaert. ### Related Issues Fixes #630 ### Notes <!-- any additional notes for this PR --> ### Follow-up Tasks <!-- anything that is related to this PR but not done here should be noted under this section --> <!-- if there is a need for a new issue, please link it here --> ### How to test <!-- if applicable, add testing instructions under this section --> --------- Signed-off-by: Lukas Reining <[email protected]> Co-authored-by: Todd Baert <[email protected]>
Both the web and server SDK use a hook interface defined in
/shared
akacore
.In web, the hook calls are not awaited, so the promise is somewhat useless.
I'm fairly certain this is a bug. We can allow the server to return both promises and non, but the web SDK cannot return Promises in hooks because it doesn't await them and has a synchronous API.
cc @beeme1mr @lukas-reining
The text was updated successfully, but these errors were encountered: