Skip to content

fix(desktop): keep false-like process_person_profile out of $set dedup - #716

Merged
turnipdabeets merged 2 commits into
chore/v6-posthog-ios-4from
fix/v6-personless-dedup-false-like
Nov 9, 2026
Merged

turnipdabeets merged 2 commits into
chore/v6-posthog-ios-4from
fix/v6-personless-dedup-false-like

Conversation

@turnipdabeets

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

Follow-up to this review comment on #637.

On Windows and Linux, the desktop core remembers the last $set it sent so it can drop identical repeats. It doesn't record a personless $set, but it only recognized boolean false as personless. Capture also reads 'no', 'false', 'off', 0 and 0.0 as false. A setPersonProperties(..., options: {'process_person_profile': 'no'}) call was therefore cached as the last profile update. The next identical setter without the option was then dropped as a duplicate, and the profile update was lost.

_isPersonless now treats any value other than null or true as possibly personless. This only affects dedup. Option values are still sent as given, as sdk-specs#146 requires. If a value is odd, like 'yes', the worst case is one extra $set, never a lost one.

The bug never shipped: options on setPersonProperties are new in 6.0, so no changeset.

💚 How did you test it?

  • I parameterized the existing personless-setter test in posthog_flutter_desktop_test.dart over false, 'no', 'false', 'off', 0 and 0.0. It runs through the real desktop queue against the local capture server. A third identical setter in each case checks that normal dedup still drops repeats.
  • Without the fix, the five non-boolean cases fail and false passes, which matches the review. With the fix, all six pass.
  • Full flutter test: 1572 passed.

📝 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 breaking change or entry added to the changelog.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

  • Claude Code. I checked the fix against sdk-specs#146, which says SDKs send option values unchanged. That rules out normalizing the value and leaves the internal dedup check as the place to fix this.
  • I chose to treat anything other than true as personless instead of copying capture's exact list of false values, so the SDK doesn't drift if capture's parser changes.

🤖 Generated with Claude Code

Capture reads 'no', 'false', 'off', 0 and 0.0 as false, so a $set sent
with one of them is personless. The desktop core only recognised boolean
false, cached that event's hash, and dropped the next identical
setPersonProperties as a duplicate, losing the profile update.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@turnipdabeets
turnipdabeets requested a review from a team as a code owner November 9, 2026 20:58
@turnipdabeets turnipdabeets self-assigned this Nov 9, 2026
@veria-ai

veria-ai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

PR overview

No security issues were found in this pull request.

Reviews

@posthog posthog Bot 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.

PostHog Review · Standard · reviewed b1f248c: 1 Should fix.

See this review and its findings in PostHog Review. Comment @posthog review --deep for a Deep review. A Deep review takes longer and looks deeper than a Standard review.

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

posthog-flutter Compliance Report

Date: 2026-11-09T21:18:03.825990+00:00
Duration: 369766ms

✅ All Tests Passed!

232/232 tests passed


Capture_V1 Tests

✅ 105/105 tests passed

View Details
Test Status Duration
Endpoint And Method.Targets V1 Endpoint ✅ 202ms
Endpoint And Method.Does Not Use Legacy Endpoints ✅ 122ms
Required Headers.Has Authorization Bearer Header ✅ 119ms
Required Headers.Has Content Type Json ✅ 119ms
Required Headers.Has Posthog Sdk Info Format ✅ 117ms
Required Headers.Has Posthog Attempt Header ✅ 117ms
Required Headers.Has Posthog Request Id ✅ 117ms
Required Headers.Has Posthog Request Timestamp ✅ 117ms
Required Headers.Has User Agent ✅ 119ms
Body Format.Body Has Created At And Batch ✅ 115ms
Body Format.No Api Key In Body ✅ 118ms
Body Format.No Sent At In Body ✅ 115ms
Event Format.Event Has Required Root Fields ✅ 117ms
Event Format.Event Uuid Is Valid ✅ 115ms
Event Format.Event Timestamp Is Rfc3339 ✅ 116ms
Event Format.Non Utc Event Timestamp Is Converted To Utc ✅ 115ms
Event Format.Distinct Id Is String ✅ 116ms
Event Format.Distinct Id At Root Not Properties ✅ 117ms
Event Format.Custom Properties Preserved ✅ 116ms
Event Format.Set Properties Preserved ✅ 118ms
Event Format.Set Once Properties Preserved ✅ 115ms
Event Format.Groups Properties Preserved ✅ 115ms
Event Format.Sdk Generates Uuid If Not Provided ✅ 116ms
Event Format.Event Has Required Root Fields Batch ✅ 119ms
Event Format.Event Uuid Is Valid Batch ✅ 120ms
Event Format.Event Timestamp Is Rfc3339 Batch ✅ 119ms
Event Format.Distinct Id Is String Batch ✅ 119ms
Event Format.Distinct Id At Root Not Properties Batch ✅ 120ms
Event Format.Custom Properties Preserved Batch ✅ 124ms
Event Format.Set Properties Preserved Batch ✅ 120ms
Event Format.Set Once Properties Preserved Batch ✅ 120ms
Event Format.Groups Properties Preserved Batch ✅ 119ms
Event Format.Sdk Generates Uuid If Not Provided Batch ✅ 119ms
Batch Behavior.Multiple Events In Single Batch ✅ 122ms
Batch Behavior.Batch Envelope Smoke ✅ 121ms
Batch Behavior.Flush With No Events Sends Nothing ✅ 108ms
Batch Behavior.Flush At Triggers Batch ✅ 1013ms
Batch Behavior.Created At Reflects Batch Creation Time ✅ 117ms
Deduplication.Generates Unique Uuids ✅ 123ms
Deduplication.Different Events Same Content Different Uuids ✅ 117ms
Deduplication.Preserves Uuid On Retry ✅ 5125ms
Deduplication.Preserves Timestamp On Retry ✅ 5121ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 5125ms
Deduplication.No Duplicate Events In Batch ✅ 125ms
Header Behavior On Retry.Attempt Header Starts At One ✅ 114ms
Header Behavior On Retry.Attempt Header Increments On Retry ✅ 10120ms
Header Behavior On Retry.Request Id Preserved On Retry ✅ 5116ms
Header Behavior On Retry.Different Requests Have Different Request Ids ✅ 2228ms
Header Behavior On Retry.Request Timestamp Changes On Retry ✅ 5121ms
Response Format Validation.Success Response Has Uuid Keyed Results ✅ 115ms
Response Format Validation.Success Response Has Ok For Each Event ✅ 119ms
Response Format Validation.Success No Retry After When All Ok ✅ 118ms
Response Format Validation.Success Retry After Present When Retry Events ✅ 118ms
Response Format Validation.Success No Retry After When Drop Only ✅ 119ms
Response Format Validation.Response Echoes Request Id ✅ 114ms
Retry Behavior.Retries On 408 ✅ 5119ms
Retry Behavior.Retries On 500 ✅ 5120ms
Retry Behavior.Retries On 503 ✅ 5120ms
Retry Behavior.Retries On 504 ✅ 5123ms
Retry Behavior.Retries On 404 ✅ 5123ms
Retry Behavior.Retries On 429 ✅ 5120ms
Retry Behavior.Retries On 502 ✅ 5120ms
Retry Behavior.Retryable Errors Have Retry After ✅ 2119ms
Retry Behavior.Respects Retry After On Retryable Error ✅ 8125ms
Retry Behavior.Does Not Retry On 400 ✅ 2117ms
Retry Behavior.Does Not Retry On 401 ✅ 2117ms
Retry Behavior.Does Not Retry On 402 ✅ 2117ms
Retry Behavior.Does Not Retry On 413 ✅ 2118ms
Retry Behavior.Does Not Retry On 415 ✅ 2117ms
Retry Behavior.Non Retryable Errors Have No Retry After ✅ 2117ms
Retry Behavior.Implements Backoff ✅ 12128ms
Partial Batch Handling.Handles 200 Full Success ✅ 2117ms
Partial Batch Handling.Handles 200 With All Ok ✅ 3124ms
Partial Batch Handling.Does Not Retry Dropped Events ✅ 3120ms
Partial Batch Handling.Does Not Retry Warning Events ✅ 3120ms
Partial Batch Handling.Prunes Ok Events On Partial Retry ✅ 5122ms
Partial Batch Handling.Prunes Dropped Events On Partial Retry ✅ 5123ms
Partial Batch Handling.Retries Only Retry Events From Partial ✅ 5127ms
Partial Batch Handling.Partial Retry Preserves Uuids ✅ 5121ms
Partial Batch Handling.Partial Retry Attempt Header Increments ✅ 5123ms
Partial Batch Handling.Partial Retry Request Id Preserved ✅ 5123ms
Partial Batch Handling.Respects Retry After On Partial ✅ 5121ms
Partial Batch Handling.Unknown Result Treated As Terminal ✅ 3120ms
Partial Batch Handling.Mixed Ok Drop Warning No Retry ✅ 3123ms
Compression.Sends Gzip Content Encoding ✅ 117ms
Compression.No Content Encoding When Disabled ✅ 114ms
Compression.Compressed Body Is Decompressible ✅ 116ms
Error Handling.Does Not Retry On Unknown 4Xx ✅ 2117ms
Event Options.Cookieless Mode Override ✅ 115ms
Event Options.Disable Skew Correction Override ✅ 113ms
Event Options.Process Person Profile Override ✅ 114ms
Event Options.Product Tour Id Override ✅ 117ms
Event Options.Unset Options Omitted ✅ 115ms
Event Options.Options Override In Batch ✅ 118ms
Event Options.Unknown Option Passes Through ✅ 114ms
Event Options.Option Value Is Not Converted ✅ 113ms
Event Options.Lenient Bool Option Values Are Not Converted ✅ 114ms
Event Options.Option Wins Over Legacy Property ✅ 114ms
Event Options.Legacy Property Fills Unset Option ✅ 113ms
Event Options.Null Option Falls Back To Legacy Property ✅ 113ms
Property Layers.Caller Property Beats Registered Property ✅ 114ms
Property Layers.Before Send Runs Last ✅ 114ms
Fail Open.Empty Api Key Sends Nothing ✅ 1110ms
Fail Open.Personal Api Key Sends Nothing ✅ 1110ms
Geoip And Historical Migration.Historical Migration Absent By Default ✅ 116ms

Capture_Ai_V1 Tests

✅ 110/110 tests passed

View Details
Test Status Duration
Endpoint And Method.Targets V1 Endpoint ✅ 115ms
Endpoint And Method.Does Not Use Legacy Endpoints ✅ 114ms
Endpoint And Method.Capture Does Not Reroute Ai Named Events ✅ 113ms
Endpoint And Method.Capture Ai Does Not Reroute Non Ai Events ✅ 113ms
Lane Isolation.Failing Ai Lane Does Not Delay Analytics ✅ 5127ms
Required Headers.Has Authorization Bearer Header ✅ 115ms
Required Headers.Has Content Type Json ✅ 114ms
Required Headers.Has Posthog Sdk Info Format ✅ 113ms
Required Headers.Has Posthog Attempt Header ✅ 114ms
Required Headers.Has Posthog Request Id ✅ 113ms
Required Headers.Has Posthog Request Timestamp ✅ 114ms
Required Headers.Has User Agent ✅ 113ms
Body Format.Body Has Created At And Batch ✅ 113ms
Body Format.No Api Key In Body ✅ 113ms
Body Format.No Sent At In Body ✅ 113ms
Event Format.Event Has Required Root Fields ✅ 113ms
Event Format.Event Uuid Is Valid ✅ 114ms
Event Format.Event Timestamp Is Rfc3339 ✅ 114ms
Event Format.Non Utc Event Timestamp Is Converted To Utc ✅ 115ms
Event Format.Distinct Id Is String ✅ 113ms
Event Format.Distinct Id At Root Not Properties ✅ 113ms
Event Format.Custom Properties Preserved ✅ 113ms
Event Format.Set Properties Preserved ✅ 113ms
Event Format.Set Once Properties Preserved ✅ 113ms
Event Format.Groups Properties Preserved ✅ 113ms
Event Format.Sdk Generates Uuid If Not Provided ✅ 113ms
Event Format.Event Has Required Root Fields Batch ✅ 116ms
Event Format.Event Uuid Is Valid Batch ✅ 116ms
Event Format.Event Timestamp Is Rfc3339 Batch ✅ 118ms
Event Format.Distinct Id Is String Batch ✅ 117ms
Event Format.Distinct Id At Root Not Properties Batch ✅ 116ms
Event Format.Custom Properties Preserved Batch ✅ 117ms
Event Format.Set Properties Preserved Batch ✅ 118ms
Event Format.Set Once Properties Preserved Batch ✅ 117ms
Event Format.Groups Properties Preserved Batch ✅ 117ms
Event Format.Sdk Generates Uuid If Not Provided Batch ✅ 117ms
Batch Behavior.Multiple Events In Single Batch ✅ 121ms
Batch Behavior.Batch Envelope Smoke ✅ 119ms
Batch Behavior.Flush At Triggers Batch ✅ 1012ms
Batch Behavior.Created At Reflects Batch Creation Time ✅ 113ms
Deduplication.Generates Unique Uuids ✅ 121ms
Deduplication.Different Events Same Content Different Uuids ✅ 116ms
Deduplication.Preserves Uuid On Retry ✅ 5119ms
Deduplication.Preserves Timestamp On Retry ✅ 5120ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 5123ms
Deduplication.No Duplicate Events In Batch ✅ 121ms
Header Behavior On Retry.Attempt Header Starts At One ✅ 114ms
Header Behavior On Retry.Attempt Header Increments On Retry ✅ 10123ms
Header Behavior On Retry.Request Id Preserved On Retry ✅ 5119ms
Header Behavior On Retry.Different Requests Have Different Request Ids ✅ 2226ms
Header Behavior On Retry.Request Timestamp Changes On Retry ✅ 5119ms
Response Format Validation.Success Response Has Uuid Keyed Results ✅ 114ms
Response Format Validation.Success Response Has Ok For Each Event ✅ 118ms
Response Format Validation.Success No Retry After When All Ok ✅ 116ms
Response Format Validation.Success Retry After Present When Retry Events ✅ 117ms
Response Format Validation.Success No Retry After When Drop Only ✅ 115ms
Response Format Validation.Response Echoes Request Id ✅ 114ms
Retry Behavior.Retries On 408 ✅ 5119ms
Retry Behavior.Retries On 500 ✅ 5120ms
Retry Behavior.Retries On 503 ✅ 5116ms
Retry Behavior.Retries On 504 ✅ 5120ms
Retry Behavior.Retries On 404 ✅ 5120ms
Retry Behavior.Retries On 429 ✅ 5120ms
Retry Behavior.Retries On 502 ✅ 5119ms
Retry Behavior.Retryable Errors Have Retry After ✅ 2117ms
Retry Behavior.Respects Retry After On Retryable Error ✅ 8123ms
Retry Behavior.Does Not Retry On 400 ✅ 2117ms
Retry Behavior.Does Not Retry On 401 ✅ 2117ms
Retry Behavior.Does Not Retry On 402 ✅ 2116ms
Retry Behavior.Does Not Retry On 413 ✅ 2116ms
Retry Behavior.Does Not Retry On 415 ✅ 2116ms
Retry Behavior.Non Retryable Errors Have No Retry After ✅ 2118ms
Retry Behavior.Implements Backoff ✅ 12127ms
Partial Batch Handling.Handles 200 Full Success ✅ 2116ms
Partial Batch Handling.Handles 200 With All Ok ✅ 3123ms
Partial Batch Handling.Does Not Retry Dropped Events ✅ 3120ms
Partial Batch Handling.Does Not Retry Warning Events ✅ 3120ms
Partial Batch Handling.Prunes Ok Events On Partial Retry ✅ 5123ms
Partial Batch Handling.Prunes Dropped Events On Partial Retry ✅ 5125ms
Partial Batch Handling.Retries Only Retry Events From Partial ✅ 5126ms
Partial Batch Handling.Partial Retry Preserves Uuids ✅ 5122ms
Partial Batch Handling.Partial Retry Attempt Header Increments ✅ 5122ms
Partial Batch Handling.Partial Retry Request Id Preserved ✅ 5121ms
Partial Batch Handling.Respects Retry After On Partial ✅ 5122ms
Partial Batch Handling.Unknown Result Treated As Terminal ✅ 3121ms
Partial Batch Handling.Mixed Ok Drop Warning No Retry ✅ 3127ms
Compression.Sends Gzip Content Encoding ✅ 114ms
Compression.No Content Encoding When Disabled ✅ 112ms
Compression.Compressed Body Is Decompressible ✅ 114ms
Error Handling.Does Not Retry On Unknown 4Xx ✅ 2117ms
Event Options.Cookieless Mode Override ✅ 114ms
Event Options.Disable Skew Correction Override ✅ 113ms
Event Options.Process Person Profile Override ✅ 113ms
Event Options.Product Tour Id Override ✅ 113ms
Event Options.Unset Options Omitted ✅ 114ms
Event Options.Options Override In Batch ✅ 118ms
Event Options.Unknown Option Passes Through ✅ 113ms
Event Options.Option Value Is Not Converted ✅ 113ms
Event Options.Lenient Bool Option Values Are Not Converted ✅ 113ms
Event Options.Option Wins Over Legacy Property ✅ 114ms
Event Options.Legacy Property Fills Unset Option ✅ 113ms
Event Options.Null Option Falls Back To Legacy Property ✅ 114ms
Event Size.Event Over Ceiling Is Not Sent ✅ 4017ms
Event Size.Over Ceiling Drop Is Reported Or Logged Without Content ✅ 2180ms
Event Size.Batches Close Before Byte Target ✅ 6089ms
Geoip And Historical Migration.Historical Migration Absent By Default ✅ 116ms
Property Layers.Caller Property Beats Registered Property ✅ 113ms
Property Layers.Before Send Runs Last ✅ 113ms
Fail Open.Empty Api Key Sends Nothing ✅ 1111ms
Fail Open.Personal Api Key Sends Nothing ✅ 1109ms

Feature_Flags Tests

✅ 17/17 tests passed

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

…sing

Capture reads strings and numbers such as 'yes' or 'no' either way, so a
$set sent with one leaves the profile's state unknown. Keeping the old
hash dropped a later revert to that value; clear it instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@turnipdabeets
turnipdabeets merged commit 5094a65 into chore/v6-posthog-ios-4 Nov 9, 2026
20 of 23 checks passed
@turnipdabeets
turnipdabeets deleted the fix/v6-personless-dedup-false-like branch November 9, 2026 23:15
@turnipdabeets turnipdabeets mentioned this pull request Nov 13, 2026
6 of 17 tasks
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