Skip to content

Description of the PersonProperties in AllFeatureFlagsOptions is wrong #74

@gioalhaz

Description

@gioalhaz
/// <summary>
/// The set of person properties that are known. Used to compute flags locally, if
/// <see cref="PostHogOptions.PersonalApiKey"/> is present and <see cref="OnlyEvaluateLocally"/> is <c>true</c>.
/// If evaluating a feature flag remotely, this is not required. It can be used to override person properties
/// on PostHog's servers when evaluating feature flags.
/// </summary>
public Dictionary<string, object?>? PersonProperties { get; init; }

You mentioned that "If evaluating a feature flag remotely, this is not required", which is not true.

Assume that we have feature flag named FF1 with release condition [email == "mymail@mail.com"].

Code, where PersonProperties is not specified, feature flag FF1 will evaluated to false

var allFlags = await posthog.GetAllFeatureFlagsAsync("userABC", new AllFeatureFlagsOptions
{
PersonProperties = null,
})

Code, where PersonProperties are specified, feature flag FF1 will evaluated to true (because release conditions where succeeded)

var allFlags = await posthog.GetAllFeatureFlagsAsync("userABC", new AllFeatureFlagsOptions
{
PersonProperties = new Dictionary<string, object?> { { "email", "mymail@mail.com" } },
})

That means that If evaluating a feature flag remotely, this is required to get correct evaluation results.

Metadata

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