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

Unexpected reloadFeatureFlags not triggering onFeatureFlags callback #1635

Open
gitrojones opened this issue Jan 3, 2025 · 0 comments
Open

Comments

@gitrojones
Copy link

Hello,

We recently updated to versions 1.200.0 and onwards and noticed some issues related to #1596.

Specifically, in v1.99.0 and earlier we were utilizing the following configuration:

{
  advanced_disable_decide: true,
  advanced_disable_feature_flags_on_first_load: true
}

to wrap posthog initialization around our own initialization logic so we could identify the user and then resolve feature flags manually via:

new Promise<void>((resolve, reject) => {
  try {
    client.onFeatureFlags((flags, variants) => {
      log.info({ flags, variants }, 'Resolve features');
      resolve();
    });

    // Trigger fetching feature flags since we've disabled feature flags by default
    client.reloadFeatureFlags();
  } catch (err) {
    log.error({ err }, 'Failed to resolve feature flags');
    reject(err);
  }
});

As of v1.200.0 and onwards it looks like advanced_disable_feature_flags_on_first_load also disables reloadFeatureFlags() silently and never triggers the onFeatureFlags callback. If we remove the disable flag, we're unable to prevent the double /decide requests. If this is intended is there another way to achieve what we had prior?

Thanks!

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

1 participant