Skip to content

getFlags removes identity identifier in evaluation context #262

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

Closed
jhoermann opened this issue Oct 18, 2024 · 8 comments · Fixed by #263
Closed

getFlags removes identity identifier in evaluation context #262

jhoermann opened this issue Oct 18, 2024 · 8 comments · Fixed by #263
Assignees

Comments

@jhoermann
Copy link
Contributor

In the current flagsmith version 7.0.1 the identity identifier gets reset within the getFlags backend call:

Image

  1. log is during init -> the identifier is set
  2. log is after getFlags / init backend call -> identifier is lost in evaluation context

This results in setContext to fail because the identifier is missing:

Image

@matthewelwell
Copy link
Contributor

Hi @jhoermann, thanks for raising this. I think I understand the issue that you're describing, but it would be very helpful for us if you are able to share a minimal example to reproduce it?

@jhoermann
Copy link
Contributor Author

Yes here: https://stackblitz.com/edit/flagsmith-bug-setcontext?file=main.js. As you can see the identifier is being stripped from the context @matthewelwell.

@matthewelwell
Copy link
Contributor

matthewelwell commented Oct 18, 2024

Great, thanks for sharing that @jhoermann - we'll take a look into this and get it fixed up. Alternatively, if you want to submit a PR, we'd gladly accept it.

@jhoermann
Copy link
Contributor Author

I opened up a PR - have a look @matthewelwell: #263. Still need to verify that this solves the issue and need to add a test for it though.

@khvn26
Copy link
Member

khvn26 commented Oct 18, 2024

Hello @jhoermann — we have identified an error in the backend that caused this issue and deployed the fix. We've observed correct behaviour in the reproduction StackBlitz you've provided. Please confirm whether the fix is working for you.

@jhoermann
Copy link
Contributor Author

Yes that resolves the issue as the identifier now gets returned by the backend endpoint @khvn26 @matthewelwell.

@khvn26 khvn26 closed this as completed Oct 21, 2024
@Roma-Potapov
Copy link

Hello, I have same problem, but in my company we use self-hosted flagsmith, and we can't just update to the newest version, so can we reopen PR of @jhoermann to fix this problem on the client side

@kyle-ssg
Copy link
Member

This is now released under version 8.0.1 🚀

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

Successfully merging a pull request may close this issue.

5 participants