Skip to content

Unexpected reloadFeatureFlags not triggering onFeatureFlags callback #1635

Open
@gitrojones

Description

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!

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions