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

Infinite polling without interval if flagConfigPollingIntervalMillis is not explicitly set #144

Closed
pdhoopr opened this issue Dec 3, 2024 · 1 comment

Comments

@pdhoopr
Copy link

pdhoopr commented Dec 3, 2024

Hi there,

It looks like #141 introduced a configurable option for the flag polling interval with the intention that it would fall back to the default of 5 minutes if the option was not explicitly set. However after upgrading, I'm seeing that if I don't explicitly configure the new flagConfigPollingIntervalMillis option, then our app sends an infinite, rapid amount of polling requests without any timeout in between.

Looking through the PR, the interval value is computed and saved to the ExperimentClient config here, but the value passed to the poller here is actually the un-computed value from the config object passed to the constructor. So presumably the following change would work, if I'm following correctly:

    this.poller = new Poller(
      () => this.doFlags(),
-      config.flagConfigPollingIntervalMillis,
+      this.config.flagConfigPollingIntervalMillis,
    );

Thanks in advance for your help!

@bgiori
Copy link
Collaborator

bgiori commented Dec 3, 2024

Thanks! Fixed in @amplitude/experiment-js-client@1.13.2 🙏

@bgiori bgiori closed this as completed Dec 3, 2024
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