Repository navigation
feat(flutter): Add replay trace ID sync for iOS - #4083
Conversation
Forward Dart trace IDs to sentry-cocoa session replay through the method channel, so iOS replay events carry trace_ids and replays can be found by trace ID. The Dart side already registered trace IDs for Android; the channel binding used on iOS/macOS was a no-op. The plugin calls SentrySDK.internal.replay.registerTraceId, available since sentry-cocoa 9.29.1. It is a no-op on macOS, where session replay is unsupported. Fixes #3729 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🚨 Detected changes in high risk code 🚨High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:
|
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Features
Fixes
DependenciesDeps
🤖 This preview updates automatically when you update the PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4083 +/- ##
==========================================
+ Coverage 88.77% 92.91% +4.13%
==========================================
Files 348 114 -234
Lines 12577 4584 -7993
==========================================
- Hits 11165 4259 -6906
+ Misses 1412 325 -1087
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
Android Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 6bcdc99 | 440.23 ms | 435.77 ms | -4.46 ms |
| c5cf749 | 379.18 ms | 360.60 ms | -18.58 ms |
| 75d2fb9 | 348.30 ms | 378.08 ms | 29.78 ms |
| b6c8720 | 457.41 ms | 519.04 ms | 61.63 ms |
| 3135a81 | 424.33 ms | 423.63 ms | -0.70 ms |
| d3fb366 | 391.49 ms | 385.85 ms | -5.64 ms |
| 4298701 | 524.40 ms | 633.30 ms | 108.90 ms |
| 3f47ea3 | 368.20 ms | 388.14 ms | 19.94 ms |
| d052aef | 372.51 ms | 355.60 ms | -16.91 ms |
| c492ba7 | 378.74 ms | 380.82 ms | 2.08 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 6bcdc99 | 13.93 MiB | 15.00 MiB | 1.06 MiB |
| c5cf749 | 14.31 MiB | 15.49 MiB | 1.19 MiB |
| 75d2fb9 | 14.77 MiB | 16.02 MiB | 1.25 MiB |
| b6c8720 | 6.54 MiB | 7.69 MiB | 1.15 MiB |
| 3135a81 | 14.30 MiB | 15.49 MiB | 1.19 MiB |
| d3fb366 | 13.93 MiB | 15.06 MiB | 1.13 MiB |
| 4298701 | 6.54 MiB | 7.71 MiB | 1.17 MiB |
| 3f47ea3 | 13.93 MiB | 15.18 MiB | 1.25 MiB |
| d052aef | 14.30 MiB | 15.49 MiB | 1.19 MiB |
| c492ba7 | 14.77 MiB | 16.08 MiB | 1.31 MiB |
NativeChannelFixture's mocked handler had no stub for the new registerTraceId method, so SDK init in sentry_flutter_test.dart threw MissingStubError on iOS/macOS once ReplayTelemetryIntegration started forwarding trace IDs over the channel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 465ec81. Configure here.
iOS Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 4a43a5e | 1258.86 ms | 1250.59 ms | -8.27 ms |
| e99f6b7 | 1244.00 ms | 1255.35 ms | 11.35 ms |
| 3615e19 | 1225.02 ms | 1234.57 ms | 9.55 ms |
| 0fb45d0 | 1273.24 ms | 1286.44 ms | 13.19 ms |
| 393f8ec | 1256.45 ms | 1259.60 ms | 3.16 ms |
| 2cf9161 | 1248.33 ms | 1266.55 ms | 18.22 ms |
| cba2765 | 1247.39 ms | 1246.96 ms | -0.43 ms |
| f4a14f7 | 1261.31 ms | 1255.74 ms | -5.57 ms |
| 8541716 | 1270.18 ms | 1271.80 ms | 1.62 ms |
| bc7a953 | 1245.18 ms | 1256.78 ms | 11.60 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 4a43a5e | 5.83 MiB | 6.28 MiB | 460.36 KiB |
| e99f6b7 | 5.91 MiB | 6.35 MiB | 451.25 KiB |
| 3615e19 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
| 0fb45d0 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
| 393f8ec | 5.53 MiB | 6.01 MiB | 488.10 KiB |
| 2cf9161 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
| cba2765 | 5.53 MiB | 5.96 MiB | 444.84 KiB |
| f4a14f7 | 5.83 MiB | 6.28 MiB | 457.79 KiB |
| 8541716 | 5.53 MiB | 6.00 MiB | 479.96 KiB |
| bc7a953 | 5.91 MiB | 6.35 MiB | 449.93 KiB |
📜 Description
Forward Dart trace IDs to sentry-cocoa Session Replay so iOS replay events carry
trace_idsand replays can be searched by trace ID.💡 Motivation and Context
Fixes #3729 on iOS (Android shipped in #3744)
💚 How did you test it?
📝 Checklist
sendDefaultPiiis enabled🔮 Next steps
Changelog Entry