Repository navigation
Conversation
Cocoa matches a plain string in `failedRequestTargets` as a substring of the URL and treats only NSRegularExpression targets as regexes. KMP passed its targets through as strings, so the default `.*` matched no URL and HTTP client errors were never captured on Apple. Pass each target both as a string and as a regex, so a target matches when the URL contains it or when its regex matches anywhere in the URL. This matches the JavaScript, Python, Cocoa and Dart SDKs. Targets that aren't valid regexes keep matching as strings. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
jadlr
force-pushed
the
fix/apple-failed-request-targets
branch
from
October 16, 2026 06:24
784c48d to
4cc2392
Compare
This branch has not been deployed
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.
📜 Description
Passes each
failedRequestTargetsentry to Cocoa both as a string and as anNSRegularExpression. A target matches when the URL contains it or when its regex matches anywhere in the URL. A target that isn't a valid regex is passed as a string only. The KDoc offailedRequestTargetsnow states the matching rule.💡 Motivation and Context
Closes #591
Cocoa matches an
NSStringtarget as a substring and only anNSRegularExpressionas a regex. KMP passed its targets as strings, so the default.*matched no URL, and HTTP client errors were never captured on Apple with default options.As discussed in #591, the regex is not anchored, matching the JavaScript, Python, Cocoa and Dart SDKs.
After this fix, apps on default options will start sending HTTP client error events (500–599) from Apple. The changelog entry says so.
💚 How did you test it?
FailedRequestTargetsOptionsTestchecks the targets KMP hands to Cocoa against a copy of Cocoa's matching rule, which isn't exposed to Kotlin. It covers the default target, a plain host, a regex, a regex matching part of a URL, and an invalid regex. Onmain, the default-target and both regex cases fail; with the fix, all pass.iosSimulatorArm64TestandmacosArm64Test: all tests pass.spotlessApply,detektandapiCheckpass.📝 Checklist
You have to check all boxes before merging:
sendDefaultPIIis enabled.🤖 Generated with Claude Code