Skip to content

fix: Support stack traces for standalone clients#7817

Merged
denrase merged 16 commits into
mainfrom
fix/standalone-client-stacktrace-regression
May 18, 2026
Merged

fix: Support stack traces for standalone clients#7817
denrase merged 16 commits into
mainfrom
fix/standalone-client-stacktrace-regression

Conversation

@denrase

@denrase denrase commented Apr 21, 2026

Copy link
Copy Markdown
Collaborator

📜 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:

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

denrase added 2 commits April 21, 2026 16:50
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
@denrase

denrase commented Apr 21, 2026

Copy link
Copy Markdown
Collaborator Author

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

codecov Bot commented Apr 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.539%. Comparing base (e337271) to head (2bf6c74).
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@              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               
Files with missing lines Coverage Δ
SentryTestUtils/Sources/TestClient.swift 87.596% <100.000%> (+0.396%) ⬆️
Sources/Sentry/SentryClient.m 98.769% <100.000%> (+0.006%) ⬆️
...ces/Swift/Core/Helper/SentryBinaryImageCache.swift 96.078% <100.000%> (+0.245%) ⬆️

... and 5 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e337271...2bf6c74. Read the comment docs.

@denrase

denrase commented Apr 21, 2026

Copy link
Copy Markdown
Collaborator Author

This also moves the init away from the man callback in start, also need to check after @supervacuus PR.

denrase added 7 commits May 4, 2026 15:56
@denrase denrase added the ready-to-merge Use this label to trigger all PR workflows label May 11, 2026
@denrase denrase marked this pull request as ready for review May 11, 2026 14:46
@denrase denrase changed the title fix: Restore stack trace image metadata for standalone clients fix: Support stack traces for standalone clients May 11, 2026
@sentry

sentry Bot commented May 11, 2026

Copy link
Copy Markdown

📲 Install Builds

iOS

🔗 App Name App ID Version Configuration
SDK-Size io.sentry.sample.SDK-Size 9.13.0 (1) Release

⚙️ sentry-cocoa Build Distribution Settings

@github-actions

github-actions Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1211.90 ms 1242.31 ms 30.41 ms
Size 24.14 KiB 1.16 MiB 1.13 MiB

Baseline results on branch: main

Startup times

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

@itaybre

itaybre commented May 12, 2026

Copy link
Copy Markdown
Contributor

@denrase looks like tests are still broken

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

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

Comment thread Sources/Swift/Core/Helper/SentryBinaryImageCache.swift

@philprime philprime left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one feedback point to address.

Comment thread Sources/Swift/Core/Helper/SentryBinaryImageCache.swift
Comment thread Sources/Swift/Core/Helper/SentryBinaryImageCache.swift
Comment thread Sources/Sentry/SentryClient.m Outdated
Comment thread Tests/SentryTests/SentryBinaryImageCacheTests.swift Outdated
@denrase denrase enabled auto-merge (squash) May 18, 2026 12:09
Comment thread Sources/Swift/Core/Helper/SentryBinaryImageCache.swift
@denrase denrase merged commit 909f4ae into main May 18, 2026
213 checks passed
@denrase denrase deleted the fix/standalone-client-stacktrace-regression branch May 18, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Use this label to trigger all PR workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stack trace symbols missing after upgrading to 8.9.0 or later

3 participants