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

IsFeatureEnabled and GetFeatureFlagPayload behave differently for mismatch

Open andykellr opened this issue 5 months ago • 0 comments

With OnlyEvaluateLocally: true set on the FeatureFlagPayload and no match for the provided payload,

IsFeatureEnabled will return false, nil

GetFeatureFlagPayload will return "", errors.New("unable to compute flag locally")

I would expect GetFeatureFlagPayload to return an empty payload and either no error or a known error, something like NoMatchError.

At least I would suggest documenting that GetFeatureFlagPayload will return an error if there is no match. The error unable to compute flag locally suggests that it was unable to compute the flag locally, not that it didn't match the rule.

andykellr avatar Sep 23 '24 19:09 andykellr