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

LDProvider should use the latest flags when it is mounted #237

Open
bufferings opened this issue Feb 14, 2024 · 1 comment
Open

LDProvider should use the latest flags when it is mounted #237

bufferings opened this issue Feb 14, 2024 · 1 comment

Comments

@bufferings
Copy link

Describe the bug

The LDProvider returned by asyncWithLDProvider keeps using the initial flags on mount even though the flags are updated.

To reproduce

  1. Call asyncWithLDProvider and it gets initial flags for example {}
  2. Mount the LDProvider and call identify to update the flag to something like {flag1: { value: true}}
  3. The ldClient keeps the latest flags {flag1: { value: true}} on memory. But the LDProvider closure keeps the initial flags {} 4. When we re-mount the LDProvider for some reason, it uses the initial flags for the initial value of the context.
  4. Call the identify again to get the latest flags. The {flag1: { value: true}} is fetched, but the ldClient says "The flags are the same as the current one, so I don't emit the change event".
  5. And the provider keeps the {} flags as its context.

Expected behavior

LDProvider should use the latest flags, which are the same as the ldClient keeps.

Additional context

I will send a pull request to explain the issue :)

@yusinto
Copy link
Contributor

yusinto commented Mar 14, 2024

We are investigating this internally as #234809.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants