Skip to content

feat!: mark frames from other frameworks as not in-app by default - #1087

Merged
turnipdabeets merged 1 commit into
chore/v4-remove-deprecatedfrom
feat/v4-in-app-by-default-false
Nov 16, 2026
Merged

turnipdabeets merged 1 commit into
chore/v4-remove-deprecatedfrom
feat/v4-in-app-by-default-false

Conversation

@turnipdabeets

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

From @marandaneto's suggestion on #1084, for 4.0.

Today any binary that isn't a known system framework counts as in-app, so third-party frameworks show up in error tracking as the app's own code. This changes errorTrackingConfig.inAppByDefault from true to false. Frames are then in-app only when they come from the app's executable or a binary in inAppIncludes. The bundle ID and executable name are already added to inAppIncludes automatically.

That's Android's rule: it adds the app's package name to inAppIncludes, and nothing else is in-app.

What it doesn't cover: iOS matches on the binary, not the Swift module. Code linked statically into the app, which is most Swift packages and 4.0's default, is part of the app's executable and stays in-app. Telling third-party code apart inside one binary would need the Swift module name from symbols, which stripped builds don't have on the client. So this mainly affects dynamic frameworks: binary XCFrameworks and dynamically linked pods.

Changes

  • inAppByDefault defaults to false, and its doc comment explains what is and isn't in-app.
  • A line in the 4.0 changeset, and a "Check in-app frames" section plus checklist item in MIGRATION.md.
  • The default-config check is added to the existing usesInAppByDefault test.

Who's affected:

  • Apps that ship their own code in a dynamic framework whose name doesn't start with the executable name or bundle ID. They add it to inAppIncludes, or set inAppByDefault = true to go back to 3.x.x behavior.
  • React Native apps with nativeAutocapture on. The plugin doesn't set inAppByDefault, so native crash frames from dynamic frameworks such as Hermes become not in-app.
  • Not Flutter: it always sends its own inAppByDefault (default true) to the iOS SDK.
  • Grouping: V1 fingerprints hash only in-app frames, so some older V1-keyed issues can regroup once. V2 hashes all frames and isn't affected. Error tracking confirmed regrouping is fine in the fix(error-tracking): start handled-error stack traces at the caller #1079 discussion.

💚 How did you test it?

  • make test with the error-tracking suites (stack trace, caller stack, crash report, memory exception, exception processor): 78 tests pass.
  • swiftlint and swiftformat --lint pass on the changed files, and git diff --check is clean.
  • The one simulator-only test that checks in-app (PostHogMemoryExceptionReporterTest) already sets inAppByDefault = false.

📝 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.

If releasing new changes

  • Ran pnpm changeset to generate a changeset file

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Claude Code (Opus 5.5), directed by @turnipdabeets. Compared Android's and Flutter's in-app rules and cymbal's fingerprinting before choosing to change only the default. Leaving include/exclude precedence alone (iOS: includes win, Android: excludes win) to keep this to one behavior change. The generated references/ docs update on release.

🤖 Generated with Claude Code

Change errorTrackingConfig.inAppByDefault to false, so only frames from the
app's executable and inAppIncludes are in-app. Third-party dynamic
frameworks no longer show up as app code. Matches Android, which only marks
the app's own package as in-app.
@turnipdabeets
turnipdabeets requested a review from a team as a code owner November 16, 2026 16:30
@turnipdabeets turnipdabeets self-assigned this Nov 16, 2026
@veria-ai

veria-ai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

PR overview

No security issues were found in this pull request.

Reviews

@turnipdabeets
turnipdabeets merged commit ca77f04 into chore/v4-remove-deprecated Nov 16, 2026
46 checks passed
@turnipdabeets
turnipdabeets deleted the feat/v4-in-app-by-default-false branch November 16, 2026 16:49
@github-actions

Copy link
Copy Markdown
Contributor

posthog-ios Compliance Report

Date: 2026-11-16T17:03:20.461850+00:00
Duration: 1012653ms

✅ All Tests Passed!

234/234 tests passed


Capture_V1 Tests

✅ 106/106 tests passed

View Details
Test Status Duration
Endpoint And Method.Targets V1 Endpoint ✅ 3174ms
Endpoint And Method.Does Not Use Legacy Endpoints ✅ 2973ms
Required Headers.Has Authorization Bearer Header ✅ 2983ms
Required Headers.Has Content Type Json ✅ 2923ms
Required Headers.Has Posthog Sdk Info Format ✅ 2929ms
Required Headers.Has Posthog Attempt Header ✅ 2910ms
Required Headers.Has Posthog Request Id ✅ 2860ms
Required Headers.Has Posthog Request Timestamp ✅ 2995ms
Required Headers.Has User Agent ✅ 582ms
Body Format.Body Has Created At And Batch ✅ 2906ms
Body Format.No Api Key In Body ✅ 2898ms
Body Format.No Sent At In Body ✅ 2933ms
Event Format.Event Has Required Root Fields ✅ 547ms
Event Format.Event Uuid Is Valid ✅ 2893ms
Event Format.Event Timestamp Is Rfc3339 ✅ 2817ms
Event Format.Non Utc Event Timestamp Is Converted To Utc ✅ 2827ms
Event Format.Distinct Id Is String ✅ 2982ms
Event Format.Distinct Id At Root Not Properties ✅ 2952ms
Event Format.Custom Properties Preserved ✅ 2927ms
Event Format.Set Properties Preserved ✅ 3032ms
Event Format.Set Once Properties Preserved ✅ 3030ms
Event Format.Groups Properties Preserved ✅ 566ms
Event Format.Sdk Generates Uuid If Not Provided ✅ 2818ms
Event Format.Event Has Required Root Fields Batch ✅ 2960ms
Event Format.Event Uuid Is Valid Batch ✅ 2993ms
Event Format.Event Timestamp Is Rfc3339 Batch ✅ 557ms
Event Format.Distinct Id Is String Batch ✅ 3070ms
Event Format.Distinct Id At Root Not Properties Batch ✅ 3031ms
Event Format.Custom Properties Preserved Batch ✅ 3075ms
Event Format.Set Properties Preserved Batch ✅ 2994ms
Event Format.Set Once Properties Preserved Batch ✅ 2891ms
Event Format.Groups Properties Preserved Batch ✅ 3122ms
Event Format.Sdk Generates Uuid If Not Provided Batch ✅ 2976ms
Batch Behavior.Multiple Events In Single Batch ✅ 3001ms
Batch Behavior.Batch Envelope Smoke ✅ 2942ms
Batch Behavior.Flush With No Events Sends Nothing ✅ 230ms
Batch Behavior.Flush At Triggers Batch ✅ 1170ms
Batch Behavior.Created At Reflects Batch Creation Time ✅ 2787ms
Deduplication.Generates Unique Uuids ✅ 2940ms
Deduplication.Different Events Same Content Different Uuids ✅ 2871ms
Deduplication.Preserves Uuid On Retry ✅ 9265ms
Deduplication.Preserves Timestamp On Retry ✅ 9249ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 8000ms
Deduplication.No Duplicate Events In Batch ✅ 3170ms
Header Behavior On Retry.Attempt Header Starts At One ✅ 2919ms
Header Behavior On Retry.Attempt Header Increments On Retry ✅ 16390ms
Header Behavior On Retry.Request Id Preserved On Retry ✅ 5580ms
Header Behavior On Retry.Different Requests Have Different Request Ids ✅ 7682ms
Header Behavior On Retry.Request Timestamp Changes On Retry ✅ 9196ms
Response Format Validation.Success Response Has Uuid Keyed Results ✅ 2844ms
Response Format Validation.Success Response Has Ok For Each Event ✅ 2955ms
Response Format Validation.Success No Retry After When All Ok ✅ 2933ms
Response Format Validation.Success Retry After Present When Retry Events ✅ 3028ms
Response Format Validation.Success No Retry After When Drop Only ✅ 2970ms
Response Format Validation.Response Echoes Request Id ✅ 2798ms
Retry Behavior.Retries On 408 ✅ 9293ms
Retry Behavior.Retries On 500 ✅ 9391ms
Retry Behavior.Retries On 503 ✅ 11480ms
Retry Behavior.Retries On 504 ✅ 9332ms
Retry Behavior.Retries On 404 ✅ 5383ms
Retry Behavior.Retries On 429 ✅ 9327ms
Retry Behavior.Retries On 502 ✅ 8859ms
Retry Behavior.Retryable Errors Have Retry After ✅ 6308ms
Retry Behavior.Respects Retry After On Retryable Error ✅ 8334ms
Retry Behavior.Does Not Retry On 400 ✅ 2440ms
Retry Behavior.Does Not Retry On 401 ✅ 4825ms
Retry Behavior.Does Not Retry On 402 ✅ 4849ms
Retry Behavior.Does Not Retry On 413 ✅ 5002ms
Retry Behavior.Does Not Retry On 415 ✅ 4779ms
Retry Behavior.Non Retryable Errors Have No Retry After ✅ 2420ms
Retry Behavior.Implements Backoff ✅ 17788ms
Partial Batch Handling.Handles 200 Full Success ✅ 4825ms
Partial Batch Handling.Handles 200 With All Ok ✅ 5798ms
Partial Batch Handling.Does Not Retry Dropped Events ✅ 5858ms
Partial Batch Handling.Does Not Retry Warning Events ✅ 5911ms
Partial Batch Handling.Prunes Ok Events On Partial Retry ✅ 7979ms
Partial Batch Handling.Prunes Dropped Events On Partial Retry ✅ 8035ms
Partial Batch Handling.Retries Only Retry Events From Partial ✅ 8039ms
Partial Batch Handling.Partial Retry Preserves Uuids ✅ 8003ms
Partial Batch Handling.Partial Retry Attempt Header Increments ✅ 7930ms
Partial Batch Handling.Partial Retry Request Id Preserved ✅ 7885ms
Partial Batch Handling.Respects Retry After On Partial ✅ 8000ms
Partial Batch Handling.Unknown Result Treated As Terminal ✅ 5924ms
Partial Batch Handling.Mixed Ok Drop Warning No Retry ✅ 5972ms
Compression.Sends Gzip Content Encoding ✅ 2894ms
Compression.No Content Encoding When Disabled ✅ 2878ms
Compression.Compressed Body Is Decompressible ✅ 2873ms
Error Handling.Does Not Retry On Unknown 4Xx ✅ 4889ms
Event Options.Cookieless Mode Override ✅ 2862ms
Event Options.Disable Skew Correction Override ✅ 2876ms
Event Options.Process Person Profile Override ✅ 549ms
Event Options.Product Tour Id Override ✅ 3005ms
Event Options.Unset Options Omitted ✅ 2989ms
Event Options.Options Override In Batch ✅ 2940ms
Event Options.Unknown Option Passes Through ✅ 2891ms
Event Options.Option Value Is Not Converted ✅ 2924ms
Event Options.Lenient Bool Option Values Are Not Converted ✅ 2855ms
Event Options.Option Wins Over Legacy Property ✅ 2857ms
Event Options.Legacy Property Fills Unset Option ✅ 2940ms
Event Options.Null Option Falls Back To Legacy Property ✅ 2869ms
Property Layers.Caller Property Beats Registered Property ✅ 2934ms
Property Layers.Before Send Runs Last ✅ 542ms
Fail Open.Empty Api Key Sends Nothing ✅ 1333ms
Fail Open.Personal Api Key Sends Nothing ✅ 1400ms
Geoip And Historical Migration.Geoip Disable Injected Into Properties ✅ 2920ms
Geoip And Historical Migration.Historical Migration Absent By Default ✅ 2937ms

Capture_Ai_V1 Tests

✅ 111/111 tests passed

View Details
Test Status Duration
Endpoint And Method.Targets V1 Endpoint ✅ 2979ms
Endpoint And Method.Does Not Use Legacy Endpoints ✅ 2917ms
Endpoint And Method.Capture Does Not Reroute Ai Named Events ✅ 2806ms
Endpoint And Method.Capture Ai Does Not Reroute Non Ai Events ✅ 2909ms
Lane Isolation.Failing Ai Lane Does Not Delay Analytics ✅ 11375ms
Required Headers.Has Authorization Bearer Header ✅ 2950ms
Required Headers.Has Content Type Json ✅ 517ms
Required Headers.Has Posthog Sdk Info Format ✅ 2832ms
Required Headers.Has Posthog Attempt Header ✅ 2907ms
Required Headers.Has Posthog Request Id ✅ 2878ms
Required Headers.Has Posthog Request Timestamp ✅ 2992ms
Required Headers.Has User Agent ✅ 2960ms
Body Format.Body Has Created At And Batch ✅ 2864ms
Body Format.No Api Key In Body ✅ 2947ms
Body Format.No Sent At In Body ✅ 2930ms
Event Format.Event Has Required Root Fields ✅ 2819ms
Event Format.Event Uuid Is Valid ✅ 2915ms
Event Format.Event Timestamp Is Rfc3339 ✅ 2863ms
Event Format.Non Utc Event Timestamp Is Converted To Utc ✅ 2900ms
Event Format.Distinct Id Is String ✅ 533ms
Event Format.Distinct Id At Root Not Properties ✅ 2946ms
Event Format.Custom Properties Preserved ✅ 2863ms
Event Format.Set Properties Preserved ✅ 592ms
Event Format.Set Once Properties Preserved ✅ 2890ms
Event Format.Groups Properties Preserved ✅ 531ms
Event Format.Sdk Generates Uuid If Not Provided ✅ 2807ms
Event Format.Event Has Required Root Fields Batch ✅ 2924ms
Event Format.Event Uuid Is Valid Batch ✅ 3006ms
Event Format.Event Timestamp Is Rfc3339 Batch ✅ 2998ms
Event Format.Distinct Id Is String Batch ✅ 2902ms
Event Format.Distinct Id At Root Not Properties Batch ✅ 3029ms
Event Format.Custom Properties Preserved Batch ✅ 2948ms
Event Format.Set Properties Preserved Batch ✅ 3008ms
Event Format.Set Once Properties Preserved Batch ✅ 3094ms
Event Format.Groups Properties Preserved Batch ✅ 2910ms
Event Format.Sdk Generates Uuid If Not Provided Batch ✅ 3019ms
Batch Behavior.Multiple Events In Single Batch ✅ 3087ms
Batch Behavior.Batch Envelope Smoke ✅ 3085ms
Batch Behavior.Flush At Triggers Batch ✅ 1326ms
Batch Behavior.Created At Reflects Batch Creation Time ✅ 2995ms
Deduplication.Generates Unique Uuids ✅ 3220ms
Deduplication.Different Events Same Content Different Uuids ✅ 2884ms
Deduplication.Preserves Uuid On Retry ✅ 9244ms
Deduplication.Preserves Timestamp On Retry ✅ 9264ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 7919ms
Deduplication.No Duplicate Events In Batch ✅ 3005ms
Header Behavior On Retry.Attempt Header Starts At One ✅ 659ms
Header Behavior On Retry.Attempt Header Increments On Retry ✅ 10489ms
Header Behavior On Retry.Request Id Preserved On Retry ✅ 9309ms
Header Behavior On Retry.Different Requests Have Different Request Ids ✅ 7578ms
Header Behavior On Retry.Request Timestamp Changes On Retry ✅ 5319ms
Response Format Validation.Success Response Has Uuid Keyed Results ✅ 2852ms
Response Format Validation.Success Response Has Ok For Each Event ✅ 3126ms
Response Format Validation.Success No Retry After When All Ok ✅ 3011ms
Response Format Validation.Success Retry After Present When Retry Events ✅ 2890ms
Response Format Validation.Success No Retry After When Drop Only ✅ 3074ms
Response Format Validation.Response Echoes Request Id ✅ 2942ms
Retry Behavior.Retries On 408 ✅ 9328ms
Retry Behavior.Retries On 500 ✅ 9401ms
Retry Behavior.Retries On 503 ✅ 11405ms
Retry Behavior.Retries On 504 ✅ 5462ms
Retry Behavior.Retries On 404 ✅ 9264ms
Retry Behavior.Retries On 429 ✅ 9372ms
Retry Behavior.Retries On 502 ✅ 9199ms
Retry Behavior.Retryable Errors Have Retry After ✅ 6295ms
Retry Behavior.Respects Retry After On Retryable Error ✅ 10737ms
Retry Behavior.Does Not Retry On 400 ✅ 4845ms
Retry Behavior.Does Not Retry On 401 ✅ 4764ms
Retry Behavior.Does Not Retry On 402 ✅ 4859ms
Retry Behavior.Does Not Retry On 413 ✅ 4793ms
Retry Behavior.Does Not Retry On 415 ✅ 4963ms
Retry Behavior.Non Retryable Errors Have No Retry After ✅ 4759ms
Retry Behavior.Implements Backoff ✅ 18315ms
Partial Batch Handling.Handles 200 Full Success ✅ 4834ms
Partial Batch Handling.Handles 200 With All Ok ✅ 5975ms
Partial Batch Handling.Does Not Retry Dropped Events ✅ 5870ms
Partial Batch Handling.Does Not Retry Warning Events ✅ 6014ms
Partial Batch Handling.Prunes Ok Events On Partial Retry ✅ 8112ms
Partial Batch Handling.Prunes Dropped Events On Partial Retry ✅ 7891ms
Partial Batch Handling.Retries Only Retry Events From Partial ✅ 7981ms
Partial Batch Handling.Partial Retry Preserves Uuids ✅ 8024ms
Partial Batch Handling.Partial Retry Attempt Header Increments ✅ 8028ms
Partial Batch Handling.Partial Retry Request Id Preserved ✅ 8041ms
Partial Batch Handling.Respects Retry After On Partial ✅ 8024ms
Partial Batch Handling.Unknown Result Treated As Terminal ✅ 5865ms
Partial Batch Handling.Mixed Ok Drop Warning No Retry ✅ 5896ms
Compression.Sends Gzip Content Encoding ✅ 2720ms
Compression.No Content Encoding When Disabled ✅ 2788ms
Compression.Compressed Body Is Decompressible ✅ 2997ms
Error Handling.Does Not Retry On Unknown 4Xx ✅ 5000ms
Event Options.Cookieless Mode Override ✅ 2919ms
Event Options.Disable Skew Correction Override ✅ 2908ms
Event Options.Process Person Profile Override ✅ 2965ms
Event Options.Product Tour Id Override ✅ 2900ms
Event Options.Unset Options Omitted ✅ 2915ms
Event Options.Options Override In Batch ✅ 2997ms
Event Options.Unknown Option Passes Through ✅ 2911ms
Event Options.Option Value Is Not Converted ✅ 2999ms
Event Options.Lenient Bool Option Values Are Not Converted ✅ 3011ms
Event Options.Option Wins Over Legacy Property ✅ 421ms
Event Options.Legacy Property Fills Unset Option ✅ 3057ms
Event Options.Null Option Falls Back To Legacy Property ✅ 2928ms
Event Size.Event Over Ceiling Is Not Sent ✅ 7197ms
Event Size.Over Ceiling Drop Is Reported Or Logged Without Content ✅ 2945ms
Event Size.Batches Close Before Byte Target ✅ 8789ms
Geoip And Historical Migration.Geoip Disable Injected Into Properties ✅ 2847ms
Geoip And Historical Migration.Historical Migration Absent By Default ✅ 2843ms
Property Layers.Caller Property Beats Registered Property ✅ 414ms
Property Layers.Before Send Runs Last ✅ 2884ms
Fail Open.Empty Api Key Sends Nothing ✅ 1323ms
Fail Open.Personal Api Key Sends Nothing ✅ 1384ms

Feature_Flags Tests

✅ 17/17 tests passed

View Details
Test Status Duration
Request Payload.Request With Person Properties Device Id ✅ 2940ms
Request Payload.Flags Request Uses V2 Query Param ✅ 2872ms
Request Payload.Flags Request Hits Flags Path Not Decide ✅ 2929ms
Request Payload.Flags Request Omits Authorization Header ✅ 2817ms
Request Payload.Token In Flags Body Matches Init ✅ 2869ms
Request Payload.Groups Round Trip ✅ 2860ms
Request Payload.Groups Default To Empty Object ✅ 2905ms
Request Payload.Disable Geoip False Propagates As Geoip Disable False ✅ 2866ms
Request Payload.Disable Geoip Omitted Defaults To False ✅ 2941ms
Request Payload.Flag Keys To Evaluate Contains Only Requested Key ✅ 2925ms
Request Lifecycle.No Flags Request On Init Alone ✅ 77ms
Request Lifecycle.No Flags Request On Normal Capture ✅ 2763ms
Request Lifecycle.Two Flag Calls Produce Two Remote Requests ✅ 5726ms
Request Lifecycle.Mock Response Value Is Returned To Caller ✅ 2830ms
Retry Behavior.Retries Flags On 502 ✅ 2799ms
Retry Behavior.Retries Flags On 504 ✅ 2914ms
Side Effect Events.Get Feature Flag Captures Feature Flag Called Event ✅ 2943ms

@turnipdabeets turnipdabeets mentioned this pull request Nov 16, 2026
8 of 20 tasks
turnipdabeets added a commit to PostHog/posthog-kmp that referenced this pull request Nov 17, 2026
posthog-ios 4.0 (PostHog/posthog-ios#1087) defaults inAppByDefault to
false. KMP only sent its own default (true) when errorTracking was set,
so apps without it would mark Kotlin frames in a dynamic framework as
not in-app. Always send the KMP value, as Flutter does.

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