posthog-flutter icon indicating copy to clipboard operation
posthog-flutter copied to clipboard

getFeatureFlagPayload doesn't trigger $feature_flag_called

Open lukepighetti opened this issue 10 months ago • 4 comments

Version

4.10.0

Steps to Reproduce

When getting feature flag payload data, these calls don't show up in posthog dashboard

Image

I had to add this extra call to make the data show up

extension on Posthog {
  Future<String> getStringPayload(String key) {
    getFeatureFlag(key); // trigger $feature_flag_called
    return getFeatureFlagPayload(key).then((x) => x.toString());
  }
}

Expected Result

my expectation is that if I fetch the payload it should show up in dashboards

Actual Result

xxxxxx

lukepighetti avatar Feb 20 '25 14:02 lukepighetti

Hello @lukepighetti Is that on Android or iOS, or both?

marandaneto avatar Feb 20 '25 15:02 marandaneto

Ok both, I asked the @PostHog/team-feature-flags first.

marandaneto avatar Feb 20 '25 15:02 marandaneto

@marandaneto yeah, looks like the flutter library isn't emitting the event in this scenario the same way that the other client SDKs do.

haacked avatar Mar 05 '25 01:03 haacked

@marandaneto yeah, looks like the flutter library isn't emitting the event in this scenario the same way that the other client SDKs do.

no other client captures an event for getFeatureFLagPayload, only for getFeatureFlag and isFeatureEnabled, the reason I'm not aware of but what I recall is that we don't expect people to call getFeatureFLagPayload directly before calling getFeatureFlag or isFeatureEnabled, so I guess the reason was just to not capture duplicated events?

marandaneto avatar Mar 05 '25 08:03 marandaneto