Repository navigation
fix(native): implement HTTP client interface - #5987
Conversation
PR risk: highFor commit Main concerns: reach, host performance, public contract. This label is a hint for reviewers, not an approval. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2da29b8. Configure here.
|
Mutation testing breaks the lines a PR changes on purpose, one mutation at a time, and checks that a test fails each time. A changed line no test runs fails the check, and a mutant that survives the tests only warns. Full report Sentry: tests caught 3 of 4 mutants on the changed lines
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5987 +/- ##
==========================================
+ Coverage 77.92% 78.15% +0.23%
==========================================
Files 535 537 +2
Lines 19831 20077 +246
Branches 3967 4041 +74
==========================================
+ Hits 15454 15692 +238
- Misses 3533 3542 +9
+ Partials 844 843 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The native SDK sent each envelope through a function transport that created a new `HttpClient` per envelope, blocked the capturing thread and ignored the rate limits in the response. Create the transport with `sentry_http_transport_new` instead, and send its requests with the `HttpClient` from the options. sentry-native now sends envelopes on its own transport thread and applies its rate limits, and the client can later serve the out-of-process crash daemon. Ref: #4867 Co-authored-by: Claude Opus 5.5 <[email protected]>
Both handlers replace `request.Content` with a compressed wrapper, so disposing the request left the original content undisposed. Content backed by a file kept the file open until finalization. Co-authored-by: Claude Opus 5.5 <[email protected]>
It only runs in Native AOT apps with sentry-native linked in, which no unit test can load, so every mutant in it was reported as NoCoverage. Co-authored-by: Claude Opus 5.5 <[email protected]>
0d36554 to
0d46a4c
Compare
jamescrosswell
left a comment
There was a problem hiding this comment.
The description says the client "can later serve the out-of-process crash daemon". How do you see that working?
From what I can see in 0.17.6, the daemon is the standalone sentry-crash executable (CMakeLists.txt), started as a separate process. It builds its own transport from what the parent puts in shared memory (DSN, proxy, CA certs). In a SENTRY_TRANSPORT=none build like ours, it gets the null transport (sentry_crash_daemon.c). An HttpClient in the app process can't reach that, and by the time the daemon uploads, the app has usually crashed.
Would we need to ship our own daemon executable that registers a client, or a new hook upstream? We also build with SENTRY_BACKEND=inproc today, so I assume this would come with a switch to the native backend. Not blocking this PR. I just want to know whether it should shape the design here.
A failed client start made `sentry_init` fail, so a throwing `ConfigureClient` or `CreateHttpMessageHandler` disabled native crash capture for the whole run. Now it only fails that request. Co-authored-by: Claude Opus 5.5 <[email protected]>
|
Sorry for being stingy with the last part. I've made it visible as a draft: The daemon gets its own copy of the client. sentry-native 1.0 adds |
Co-authored-by: James Crosswell <[email protected]>

Description
The native SDK sent each envelope through a function transport that created a new
HttpClientper envelope, blocked the capturing thread, and ignored the rate limits in the response.Create the transport with
sentry_http_transport_newinstead, and send its requests with theHttpClientfrom the options. sentry-native now sends envelopes on its own transport thread and applies its rate limits, and the client can later serve the out-of-process crash daemon.Issues
Refs #4867