fix: Support stack traces for standalone clients#7817
Conversation
Standalone SentryClient / SentryHub usage is publicly documented for shared and library environments, but handled events with attached stacktraces regressed after local symbolication became debug-only. In that setup, stacktrace frame image metadata and debug_meta.images depended on the binary image cache being initialized through SentrySDK.start, which standalone clients never did. This change starts the binary image cache during SentryClient initialization so standalone client and hub usage once again captures the image metadata needed for handled-event stacktrace symbolication. Closes #3409
|
We probably want to wait until @supervacuus finishes up with their binary image cache PR based on #7269 from @noahsmartin, as it may affect how this needs to be dine here and I don't want to interfere with their implemention, I'd rather update here afterwards. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7817 +/- ##
=============================================
- Coverage 85.552% 85.539% -0.014%
=============================================
Files 487 487
Lines 29659 29673 +14
Branches 12893 12890 -3
=============================================
+ Hits 25374 25382 +8
- Misses 4235 4241 +6
Partials 50 50
... and 5 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
|
This also moves the init away from the man callback in start, also need to check after @supervacuus PR. |
# Conflicts: # Sources/Swift/SentryCrash/SentryDefaultCrashReporter.swift # Tests/SentryTests/SentryCrash/TestSentryCrashWrapper.swift
- make start of swift cache idempotent - move start/stop from sentry crash reporter
📲 Install BuildsiOS
|
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 75eb224 | 1215.57 ms | 1244.74 ms | 29.17 ms |
| 6c524d8 | 1217.83 ms | 1254.02 ms | 36.20 ms |
| 85ee155 | 1227.40 ms | 1251.52 ms | 24.12 ms |
| eddca8a | 1226.17 ms | 1259.98 ms | 33.81 ms |
| 92bcc8f | 1233.43 ms | 1270.20 ms | 36.77 ms |
| ce900e7 | 1212.40 ms | 1244.57 ms | 32.18 ms |
| 44b7b59 | 1211.91 ms | 1248.90 ms | 36.99 ms |
| df67624 | 1225.12 ms | 1259.90 ms | 34.78 ms |
| adef457 | 1229.45 ms | 1262.67 ms | 33.22 ms |
| b6fa517 | 1218.83 ms | 1257.47 ms | 38.63 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 75eb224 | 24.14 KiB | 1.16 MiB | 1.13 MiB |
| 6c524d8 | 24.14 KiB | 1.15 MiB | 1.12 MiB |
| 85ee155 | 24.14 KiB | 1.16 MiB | 1.13 MiB |
| eddca8a | 24.14 KiB | 1.15 MiB | 1.13 MiB |
| 92bcc8f | 24.14 KiB | 1.15 MiB | 1.13 MiB |
| ce900e7 | 24.14 KiB | 1.15 MiB | 1.13 MiB |
| 44b7b59 | 24.14 KiB | 1.15 MiB | 1.13 MiB |
| df67624 | 24.14 KiB | 1.14 MiB | 1.12 MiB |
| adef457 | 24.14 KiB | 1.15 MiB | 1.13 MiB |
| b6fa517 | 24.14 KiB | 1.14 MiB | 1.12 MiB |
Previous results on branch: fix/standalone-client-stacktrace-regression
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| f7c5b7f | 1209.74 ms | 1246.30 ms | 36.55 ms |
| dbc88c9 | 1222.15 ms | 1255.36 ms | 33.22 ms |
| 361460e | 1217.84 ms | 1258.50 ms | 40.66 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| f7c5b7f | 24.14 KiB | 1.16 MiB | 1.13 MiB |
| dbc88c9 | 24.14 KiB | 1.16 MiB | 1.13 MiB |
| 361460e | 24.14 KiB | 1.16 MiB | 1.13 MiB |
|
@denrase looks like tests are still broken |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3dcd5a5. Configure here.
philprime
left a comment
There was a problem hiding this comment.
LGTM with one feedback point to address.

📜 Description
Standalone SentryClient / SentryHub usage is publicly documented for shared and library environments, but handled events with attached stacktraces regressed after local symbolication became debug-only. In that setup, stacktrace frame image metadata and debug_meta.images depended on the binary image cache being initialized through SentrySDK.start, which standalone clients never did.
This change starts the binary image cache during SentryClient initialization, so standalone client and hub usage once again captures the image metadata needed for handled-event stacktrace symbolication.
💡 Motivation and Context
Closes #3409
💚 How did you test it?
Unit tests. Repro with sample app.
📝 Checklist
You have to check all boxes before merging:
sendDefaultPIIis enabled.