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

updateContext and setContextField don't call fetchToggles until first fetchToggles completes #127

Closed
mc0 opened this issue Dec 1, 2022 · 2 comments · Fixed by #130
Closed
Assignees
Labels
bug Something isn't working

Comments

@mc0
Copy link

mc0 commented Dec 1, 2022

Describe the bug

After changing the context via updateContext, a new request for toggles doesn't trigger immediately. This looks like it's because the first fetchToggles and/or ready promise hasn't returned in start yet and timerRef isn't set.

Additionally, this means .start can be called multiple times until any chain of promises resolve.

Steps to reproduce the bug

  • Start a client.
  • Update the context after.
  • Observe no request for toggles with the latest context.

Expected behavior

When calling updateContext, a new request for fetchToggles should occur immediately if start has already been called.

Logs, error output, etc.

No response

Screenshots

No response

Additional context

Using @unleash/proxy-client-react and we are changing the context in a child component.

Unleash version

4.17.2

Subscription type

Pro

Hosting type

Hosted by Unleash

SDK information (language and version)

No response

@mc0 mc0 added the bug Something isn't working label Dec 1, 2022
@FredrikOseberg
Copy link
Collaborator

Hi @mc0,

Thanks for the report. We're looking into it!

@kwasniew
Copy link
Contributor

@mc0 #130 should fix it

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
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants