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

Waitable feature flags reloading #1699

Open
alexPMobal opened this issue Jan 29, 2025 · 1 comment
Open

Waitable feature flags reloading #1699

alexPMobal opened this issue Jan 29, 2025 · 1 comment

Comments

@alexPMobal
Copy link

we have a case when we change a user properties which are used to set feature flag states. in this case, docs states to use reloadFeatureFlags. however, while change happens cached flags are still used. we use vue, and this cache change is not reactive, so if the flag is used in rendering: incorrect state will be displayed until page is reloaded. if there a way around this? could reloadFeatureFlags be async so it can be simply awaited?

until v1.211.3 we could wait until featureFlags.reloadFeatureFlagsInAction, but currently props are changed for _requestInFlight and marked as private, so there seem to be no way of waiting for reload request.

@janrabek
Copy link

janrabek commented Feb 22, 2025

I have the same issue - there definitely needs to be something for awaiting reloads of feature flags. Code like this doesnt work due to race condition right now:
posthog.setPersonPropertiesForFlags({ xyzProperty: true }); const value = posthog.getFeatureFlag("xyz-flag");

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