fix(flags): handle null early_exit values - #312
Merged
Conversation
Contributor
posthog-dotnet Compliance ReportDate: 2026-09-02 14:44:48 UTC ✅ All Tests Passed!17/17 tests passed Feature_Flags Tests✅ 17/17 tests passed View Details
|
marandaneto
reviewed
Sep 2, 2026
marandaneto
approved these changes
Sep 2, 2026
dustinbyrne
marked this pull request as ready for review
September 2, 2026 14:45
Contributor
|
Reviews (1): Last reviewed commit: "chore: add PostHog.AspNetCore changeset" | Re-trigger Greptile |
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.
💡 Motivation and Context
Fixes #311.
The
/flags/definitionsresponse can containfilters.early_exit: null. The SDK modeled this field as a non-nullable boolean, soSystem.Text.Jsonrejected the response before local feature flag evaluation could begin.This makes the internal field nullable while preserving
falseas the absent-field default. The evaluator already normalizes null tofalse, so explicit null values now follow the existing non-early-exit path without changing true, false, or omitted-field behavior.A patch changeset covers
PostHog. There are no public API or default-behavior changes.💚 How did you test it?
JsonException: The JSON value could not be converted to System.Boolean.trueandnull, including the resulting local evaluation behavior.dotnet restore --locked-modebin/fmt --checkdotnet build --configuration Release --no-restore --nologo(0 warnings, 0 errors)dotnet test --configuration Release --no-build --nologo --framework net8.0UnitTests: 1,141 passed, 2 skippedUnitTests.AspNetCore: 50 passedPostHog.AI.Tests: 19 passedThe .NET Core 3.1 test binary builds successfully, but its tests were not run locally because the x64 .NET Core 3.1 host is not installed in this environment.
📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Pi coding agent (
openai-codex/gpt-5.6-sol) traced and reproduced the reported serialization failure, implemented the scoped fix test-first, and ran the Simplify skill. A fresh-context builtin reviewer found no blockers and suggested exercising evaluation after deserialization; the final regression theory covers that path for bothtrueandnull.