Skip to content
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

Flags status is incorrect when an already started unleash client is passed to flag provider #168

Closed
cemreyavuz opened this issue Jun 12, 2024 · 1 comment · Fixed by #169
Assignees
Labels
bug Something isn't working

Comments

@cemreyavuz
Copy link

cemreyavuz commented Jun 12, 2024

Describe the bug

I have a case that I want to pass an already started unleash client to the unleash flag provider. When I do that, flagsReady (returned from useFlagsStatus hook) returns false even though the client is started and ready.

Here is a reproducible example: https://stackblitz.com/edit/vitejs-vite-elpthg?file=src%2FApp.tsx.

As far as I see, this behaviour is this way due to calling the readyCallback only when we get the ready event from the client. In my case, this event is never sent since the client is already ready before the flag provider component is initialized:

client.current.on('ready', readyCallback);

I wonder if this is intentional and whether the case I mentioned is an intended way of using unleash client or not. Happy to contribute if it is decided to be an actual bug - but I might still need some pointers.

SDK information (language and version)

[email protected] and @unleash/[email protected]

@cemreyavuz cemreyavuz added the bug Something isn't working label Jun 12, 2024
@Tymek
Copy link
Member

Tymek commented Jun 12, 2024

O, that looks like a legitimate issue for sure. Thank you for providing a reproducible example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants