posthog-go
posthog-go copied to clipboard
IsFeatureEnabled and GetFeatureFlagPayload behave differently for mismatch
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.