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

Clarification for pollOnStart parameter #111

Open
marcoancona opened this issue Jun 17, 2024 · 2 comments
Open

Clarification for pollOnStart parameter #111

marcoancona opened this issue Jun 17, 2024 · 2 comments

Comments

@marcoancona
Copy link

Hi all,
We have recently started with the Experiment SDK. I was expecting pollOnStart: true to instantiate a poll mechanism that would fetch the user flags and variants on a regular basis. Inspecting the network requests and the source code, however, we found that the flag definitions are fetched every 60 seconds, but the values for the current users are not re-evaluated automatically as part of this process.

I wonder, what is the purpose of fetching the flags so often without re-evaluating the flag values? I expect the value to change more often, as this depends on user properties/events that might affect the target audience of a variant.

@bgiori
Copy link
Collaborator

bgiori commented Jul 4, 2024

You're right, pollOnStart only polls for flag configurations, it does not periodically fetch remote variants.

pollOnStart is mostly useful for local evaluation, which is a less common use case on the client-side. Unless you're using local evaluation I would recommend setting pollOnStart: false. If you want to re-fetch remote evaluation variants at an interval you would need to implement that manually in your app using setInterval or something similar.

@marcoancona
Copy link
Author

Thanks for clarifying @bgiori . Do you have a recommendation about how often it would be good to poll for this flag? Would it be a problem to fetch the flag values every minute, as pollOnStart does by default?

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