fix(feature-management): enumerate flags without PersonalApiKey#250
Merged
turnipdabeets merged 1 commit intoJul 2, 2026
Conversation
Contributor
|
Reviews (1): Last reviewed commit: "fix(feature-management): enumerate flags..." | Re-trigger Greptile |
Contributor
|
@jojosenthusiast thanks! LGTM, I think the reptile comment is worth addressing before merging #250 (comment). Mind giving that a look? I think you'll also need to sign your commits to merge the PR. |
Contributor
Author
|
I looked at the Greptile bit, removed the duplicated test constants, and both tests now use the production sentinel directly. Re-ran the fallback tests and the AspNetCore unit tests locally, so this should be good to go now. |
jojosenthusiast
force-pushed
the
fix/feature-enumeration-without-personal-api-key
branch
from
July 1, 2026 15:30
a268400 to
b747837
Compare
…piKey Without a PersonalApiKey the local evaluator is null, which left PostHogVariantFeatureManager.GetFeatureNamesAsync and PostHogFeatureDefinitionProvider.GetAllFeatureDefinitionsAsync returning nothing — breaking the MSFT Feature Management definition-driven path for SDK consumers who use the remote /flags evaluation path only. Fall back to a single /flags poll using a stable sentinel distinct_id ($feature_enumeration_sentinel) and use the returned flag keys. The sentinel stays constant so the existing in-memory /flags cache (keyed by distinct_id) reuses the response and PostHog does not spawn a new phantom person per poll. Per-flag values for the sentinel are discarded — only the key set is consumed. GetAllFeatureFlagsAsync does not emit $feature_flag_called events, so no analytics noise. Local evaluation behavior is unchanged when a PersonalApiKey exists. Refs PostHog#64.
jojosenthusiast
force-pushed
the
fix/feature-enumeration-without-personal-api-key
branch
from
July 1, 2026 15:42
b747837 to
028701a
Compare
turnipdabeets
approved these changes
Jul 2, 2026
turnipdabeets
enabled auto-merge (squash)
July 2, 2026 20:38
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #64
Summary
/flagswith a stable sentinel distinct id for feature enumeration without a PersonalApiKey.PostHogFeatureDefinitionProviderandPostHogVariantFeatureManager.Verification
dotnet test tests/UnitTests.AspNetCore --filter FullyQualifiedName~Fallback -m:1dotnet test tests/UnitTests.AspNetCore -m:1git diff --check main...HEADRisk
Medium. This affects feature flag enumeration only; no public API changes are added.