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

Undocumented behavior on functions identify and logout #103

Closed
xrash opened this issue Mar 17, 2022 · 0 comments
Closed

Undocumented behavior on functions identify and logout #103

xrash opened this issue Mar 17, 2022 · 0 comments
Assignees

Comments

@xrash
Copy link
Contributor

xrash commented Mar 17, 2022

The documentation for function identify says:

Identify as a user, optionally with traits e.g. {foo:"bar",numericProp:1,boolProp:true}. This will create a user for your environment in the dashboard if they don't exist, it will also trigger a call to getFlags(), resolves a promise when the flags are updated.

The documentation for function logout says:

Stop identifying as a user, this will trigger a call to getFlags()

As you can see, the documentation explicitly states that these functions will trigger a call to getFlags() and doesn't mention any exceptional case - but there is one exceptional case: if a listener has been set up by means of flagsmith.startListening, then neither identify or logout will call getFlags.

It looks like this exceptional case should be mentioned in the docs, or removed from the code, or addressed somehow.

This PR #104 proposes a fix.

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