Skip to content

fix(flags): align presence operator semantics - #297

Merged
marandaneto merged 1 commit into
mainfrom
fix/sdk-spec-49-presence-operators
Aug 26, 2026
Merged

fix(flags): align presence operator semantics#297
marandaneto merged 1 commit into
mainfrom
fix/sdk-spec-49-presence-operators

Conversation

@marandaneto

Copy link
Copy Markdown
Member

💡 Motivation and Context

sdk-specs PR #49 defines is_not_set using partial property context. The Go local evaluator returned an inconclusive error even when the caller supplied the property key, although a present key definitively does not match is_not_set.

This change returns false for is_not_set whenever the key is present, including null and other falsey values. An omitted key remains inconclusive.

💚 How did you test it?

  • go test ./... -run '^TestMatchPropertyPresenceOperators$'
  • go test .
  • Autoreview completed with no actionable findings.

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

If releasing new changes

  • Ran pnpm changeset to generate a changeset file

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Pi coding agent worker subagents implemented and validated the matcher change. The bundled autoreview tool reviewed the final committed diff against origin/main.

@marandaneto marandaneto self-assigned this Aug 26, 2026
@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

posthog-go Compliance Report

Date: 2026-08-26 07:50:55 UTC
Duration: 169195ms

✅ All Tests Passed!

111/111 tests passed


Capture_V1 Tests

94/94 tests passed

View Details
Test Status Duration
Endpoint And Method.Targets V1 Endpoint 24ms
Endpoint And Method.Does Not Use Legacy Endpoints 6ms
Required Headers.Has Authorization Bearer Header 5ms
Required Headers.Has Content Type Json 7ms
Required Headers.Has Posthog Sdk Info Format 7ms
Required Headers.Has Posthog Attempt Header 6ms
Required Headers.Has Posthog Request Id 6ms
Required Headers.Has Posthog Request Timestamp 6ms
Required Headers.Has User Agent 6ms
Body Format.Body Has Created At And Batch 6ms
Body Format.No Api Key In Body 6ms
Body Format.No Sent At In Body 6ms
Event Format.Event Has Required Root Fields 6ms
Event Format.Event Uuid Is Valid 6ms
Event Format.Event Timestamp Is Rfc3339 6ms
Event Format.Distinct Id Is String 6ms
Event Format.Distinct Id At Root Not Properties 6ms
Event Format.Custom Properties Preserved 6ms
Event Format.Set Properties Preserved 6ms
Event Format.Set Once Properties Preserved 6ms
Event Format.Groups Properties Preserved 6ms
Event Format.Sdk Generates Uuid If Not Provided 5ms
Event Format.Event Has Required Root Fields Batch 9ms
Event Format.Event Uuid Is Valid Batch 9ms
Event Format.Event Timestamp Is Rfc3339 Batch 8ms
Event Format.Distinct Id Is String Batch 9ms
Event Format.Distinct Id At Root Not Properties Batch 8ms
Event Format.Custom Properties Preserved Batch 8ms
Event Format.Set Properties Preserved Batch 9ms
Event Format.Set Once Properties Preserved Batch 8ms
Event Format.Groups Properties Preserved Batch 19ms
Event Format.Sdk Generates Uuid If Not Provided Batch 10ms
Batch Behavior.Multiple Events In Single Batch 29ms
Batch Behavior.Batch Envelope Smoke 10ms
Batch Behavior.Flush With No Events Sends Nothing 4ms
Batch Behavior.Flush At Triggers Batch 1007ms
Batch Behavior.Created At Reflects Batch Creation Time 7ms
Deduplication.Generates Unique Uuids 15ms
Deduplication.Different Events Same Content Different Uuids 9ms
Deduplication.Preserves Uuid On Retry 5135ms
Deduplication.Preserves Timestamp On Retry 5133ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry 5137ms
Deduplication.No Duplicate Events In Batch 31ms
Header Behavior On Retry.Attempt Header Starts At One 7ms
Header Behavior On Retry.Attempt Header Increments On Retry 10134ms
Header Behavior On Retry.Request Id Preserved On Retry 5136ms
Header Behavior On Retry.Different Requests Have Different Request Ids 2014ms
Header Behavior On Retry.Request Timestamp Changes On Retry 5137ms
Response Format Validation.Success Response Has Uuid Keyed Results 7ms
Response Format Validation.Success Response Has Ok For Each Event 28ms
Response Format Validation.Success No Retry After When All Ok 28ms
Response Format Validation.Success Retry After Present When Retry Events 130ms
Response Format Validation.Success No Retry After When Drop Only 28ms
Response Format Validation.Response Echoes Request Id 7ms
Retry Behavior.Retries On 408 5132ms
Retry Behavior.Retries On 500 5133ms
Retry Behavior.Retries On 503 5137ms
Retry Behavior.Retries On 504 5134ms
Retry Behavior.Retryable Errors Have Retry After 2133ms
Retry Behavior.Respects Retry After On Retryable Error 8140ms
Retry Behavior.Does Not Retry On 400 2133ms
Retry Behavior.Does Not Retry On 401 2133ms
Retry Behavior.Does Not Retry On 402 2133ms
Retry Behavior.Does Not Retry On 413 2133ms
Retry Behavior.Does Not Retry On 415 2133ms
Retry Behavior.Non Retryable Errors Have No Retry After 2134ms
Retry Behavior.Implements Backoff 15146ms
Retry Behavior.Max Retries Respected 15143ms
Partial Batch Handling.Handles 200 Full Success 2009ms
Partial Batch Handling.Handles 200 With All Ok 3033ms
Partial Batch Handling.Does Not Retry Dropped Events 3031ms
Partial Batch Handling.Does Not Retry Limited Events 3032ms
Partial Batch Handling.Prunes Ok Events On Partial Retry 5136ms
Partial Batch Handling.Prunes Dropped Events On Partial Retry 5133ms
Partial Batch Handling.Retries Only Retry Events From Partial 5139ms
Partial Batch Handling.Partial Retry Preserves Uuids 5133ms
Partial Batch Handling.Partial Retry Attempt Header Increments 5136ms
Partial Batch Handling.Partial Retry Request Id Preserved 5136ms
Partial Batch Handling.Respects Retry After On Partial 5136ms
Partial Batch Handling.Unknown Result Treated As Terminal 3030ms
Partial Batch Handling.Mixed Ok Drop Limited No Retry 3034ms
Compression.Sends Gzip Content Encoding 16ms
Compression.No Content Encoding When Disabled 7ms
Compression.Compressed Body Is Decompressible 6ms
Error Handling.Does Not Retry On Unknown 4Xx 2132ms
Event Options.Cookieless Mode Override 7ms
Event Options.Disable Skew Correction Override 6ms
Event Options.Process Person Profile Override 6ms
Event Options.Product Tour Id Override 6ms
Event Options.Unset Options Omitted 6ms
Event Options.Options Override In Batch 9ms
Geoip And Historical Migration.Geoip Disable Injected Into Properties 5ms
Geoip And Historical Migration.Historical Migration Set In Body 6ms
Geoip And Historical Migration.Historical Migration Absent By Default 6ms

Feature_Flags Tests

17/17 tests passed

View Details
Test Status Duration
Request Payload.Request With Person Properties Device Id 16ms
Request Payload.Flags Request Uses V2 Query Param 16ms
Request Payload.Flags Request Hits Flags Path Not Decide 16ms
Request Payload.Flags Request Omits Authorization Header 15ms
Request Payload.Token In Flags Body Matches Init 16ms
Request Payload.Groups Round Trip 16ms
Request Payload.Groups Default To Empty Object 16ms
Request Payload.Disable Geoip False Propagates As Geoip Disable False 16ms
Request Payload.Disable Geoip Omitted Defaults To False 16ms
Request Payload.Flag Keys To Evaluate Contains Only Requested Key 16ms
Request Lifecycle.No Flags Request On Init Alone 2ms
Request Lifecycle.No Flags Request On Normal Capture 6ms
Request Lifecycle.Two Flag Calls Produce Two Remote Requests 29ms
Request Lifecycle.Mock Response Value Is Returned To Caller 17ms
Retry Behavior.Retries Flags On 502 17ms
Retry Behavior.Retries Flags On 504 17ms
Side Effect Events.Get Feature Flag Captures Feature Flag Called Event 17ms

@marandaneto
marandaneto requested a review from a team August 26, 2026 10:00
@posthog-project-board-bot posthog-project-board-bot Bot moved this to In Progress in Feature Flags Aug 26, 2026
@marandaneto
marandaneto marked this pull request as ready for review August 26, 2026 10:00
@marandaneto
marandaneto requested a review from a team as a code owner August 26, 2026 10:00
@posthog-project-board-bot posthog-project-board-bot Bot moved this from In Progress to In Review in Feature Flags Aug 26, 2026
@greptile-apps

greptile-apps Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "fix(flags): align presence operator sema..." | Re-trigger Greptile

@github-project-automation github-project-automation Bot moved this from In Review to Approved in Feature Flags Aug 26, 2026
@marandaneto
marandaneto merged commit 360bc8d into main Aug 26, 2026
29 checks passed
@marandaneto
marandaneto deleted the fix/sdk-spec-49-presence-operators branch August 26, 2026 14:47
@github-project-automation github-project-automation Bot moved this from Approved to Done in Feature Flags Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants