Skip to content

fix: exclude failed Dart flag values on Windows and Linux - #721

Merged
marandaneto merged 1 commit into
mainfrom
fix/spec211-failed-flags
Nov 13, 2026
Merged

marandaneto merged 1 commit into
mainfrom
fix/spec211-failed-flags

Conversation

@marandaneto

Copy link
Copy Markdown
Member

💡 Motivation and Context

On Windows and Linux, the Dart implementation could serve a failed feature flag's placeholder value or payload and report it as a missing flag. This patch applies the failed-record rules in PostHog/sdk-specs#211 to the Windows/Linux Dart implementation only.

Failed records now return no scalar, boolean, or structured result. Bulk results, listeners, and capture enrichment omit them. Failed direct reads report evaluation_failed with a null response and retain response-wide errors independently. An errored refresh preserves successful cached values and paired payloads. A complete refresh without response-wide errors replaces state instead.

Includes a patch changeset. Dependency constraints are unchanged. Android, iOS/macOS, and web still require fixed upstream engine releases and follow-up dependency or host-JS updates. This PR does not claim native/web or full shared-harness conformance.

💚 How did you test it?

  • Seven focused regressions pass, including healthy false controls, all-failed recovery, cache boundaries, persisted reads, suppression/dedupe, and public getter/flush delivery to a local HTTP server. The original six cases produced five behavioral failures before the fix.
  • The unchanged patch previously passed the full Dart VM suite (1,320 passed, one skipped), 25 adapter tests, Dart analysis, API snapshot, and formatting checks. Focused tests, API snapshot, and scoped formatting checks were rerun before this commit.
  • An independent disk-reopen/reset probe passed. Authoring test audit and diff-scoped cleanup found no changes needed. Final committed-branch autoreview reported no actionable findings.
  • Native builds, Windows/Linux application builds, Chrome/Wasm suites, and real native/web engine tests were not run locally. VM tests do not prove platform or engine conformance.

📝 Checklist

  • All commits are signed (see Commit signing)
  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed. No public API documentation change is needed.
  • No breaking change or entry added to the changelog.

If releasing new changes

  • Added a patch changeset using the existing Changesets format.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Pi agents implemented and independently reviewed the scoped fix. Publication used Git, GitHub CLI, Flutter/Dart checks, and the isolated autoreview helper. No shareable session URL is available. The human driver is assigned as the DRI. Human review is required.

The native/web dependency updates were deliberately left out because unpublished engine fixes are not consumable version pins. Existing cache refresh boundaries and event controls were preserved rather than adding new APIs or changing dependencies.

@marandaneto marandaneto self-assigned this Nov 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

posthog-flutter Compliance Report

Date: 2026-11-12 10:31:08 UTC
Duration: 96868ms

✅ All Tests Passed!

45/45 tests passed


Capture Tests

✅ 29/29 tests passed

View Details
Test Status Duration
Format Validation.Event Has Required Fields ✅ 145ms
Format Validation.Event Has Uuid ✅ 118ms
Format Validation.Event Has Lib Properties ✅ 117ms
Format Validation.Distinct Id Is String ✅ 115ms
Format Validation.Token Is Present ✅ 115ms
Format Validation.Custom Properties Preserved ✅ 117ms
Format Validation.Event Has Timestamp ✅ 118ms
Retry Behavior.Retries On 503 ✅ 5327ms
Retry Behavior.Does Not Retry On 400 ✅ 2120ms
Retry Behavior.Does Not Retry On 401 ✅ 2119ms
Retry Behavior.Respects Retry After Header ✅ 8126ms
Retry Behavior.Implements Backoff ✅ 15432ms
Retry Behavior.Retries On 500 ✅ 5225ms
Retry Behavior.Retries On 502 ✅ 5226ms
Retry Behavior.Retries On 504 ✅ 5225ms
Retry Behavior.Max Retries Respected ✅ 15438ms
Deduplication.Generates Unique Uuids ✅ 126ms
Deduplication.Preserves Uuid On Retry ✅ 5221ms
Deduplication.Preserves Uuid And Timestamp On Retry ✅ 10335ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 5232ms
Deduplication.No Duplicate Events In Batch ✅ 123ms
Deduplication.Different Events Have Different Uuids ✅ 116ms
Compression.Sends Gzip When Enabled ✅ 117ms
Batch Format.Uses Proper Batch Structure ✅ 114ms
Batch Format.Flush With No Events Sends Nothing ✅ 109ms
Batch Format.Multiple Events Batched Together ✅ 131ms
Error Handling.Does Not Retry On 403 ✅ 2119ms
Error Handling.Does Not Retry On 413 ✅ 2121ms
Error Handling.Retries On 408 ✅ 5227ms

Feature_Flags Tests

✅ 16/16 tests passed

View Details
Test Status Duration
Request Payload.Request With Person Properties Device Id ✅ 14ms
Request Payload.Flags Request Uses V2 Query Param ✅ 11ms
Request Payload.Flags Request Hits Flags Path Not Decide ✅ 12ms
Request Payload.Flags Request Omits Authorization Header ✅ 11ms
Request Payload.Token In Flags Body Matches Init ✅ 11ms
Request Payload.Groups Round Trip ✅ 12ms
Request Payload.Groups Default To Empty Object ✅ 11ms
Request Payload.Person Properties Distinct Id Auto Populated When Caller Omits It ✅ 11ms
Request Payload.Disable Geoip False Propagates As Geoip Disable False ✅ 11ms
Request Payload.Disable Geoip Omitted Defaults To False ✅ 11ms
Request Payload.Flag Keys To Evaluate Contains Only Requested Key ✅ 11ms
Request Lifecycle.No Flags Request On Init Alone ✅ 4ms
Request Lifecycle.No Flags Request On Normal Capture ✅ 115ms
Request Lifecycle.Two Flag Calls Produce Two Remote Requests ✅ 18ms
Request Lifecycle.Mock Response Value Is Returned To Caller ✅ 11ms
Side Effect Events.Get Feature Flag Captures Feature Flag Called Event ✅ 118ms

@marandaneto
marandaneto marked this pull request as ready for review November 12, 2026 12:13
@marandaneto
marandaneto requested a review from a team as a code owner November 12, 2026 12:13
@veria-ai

veria-ai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

PR overview

No security issues were found in this pull request.

Reviews

@ioannisj ioannisj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 An AI agent wrote this on behalf of @ioannisj.

No findings. I traced the failed details through the getters, bulk results, listener and capture enrichment, and the errored-refresh merge and evaluation_failed reporting line up with the spec.

@marandaneto
marandaneto merged commit b7c9e50 into main Nov 13, 2026
30 checks passed
@marandaneto
marandaneto deleted the fix/spec211-failed-flags branch November 13, 2026 16:37
@eli-r-ph eli-r-ph mentioned this pull request Nov 13, 2026
6 of 17 tasks
turnipdabeets added a commit that referenced this pull request Nov 13, 2026
#721's failed-flags test answered every request with a /flags body,
which the capture v1 sender reads as a 2xx without per-event results.
Answer only /flags with it so capture gets its default results.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants