Skip to content

feat(flutter): Add replay trace ID sync for iOS - #4083

Merged
antonis merged 4 commits into
mainfrom
feat/cocoa-replay-trace-ids
Oct 14, 2026
Merged

antonis merged 4 commits into
mainfrom
feat/cocoa-replay-trace-ids

Conversation

@antonis

@antonis antonis commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

📜 Description

Forward Dart trace IDs to sentry-cocoa Session Replay so iOS replay events carry trace_ids and replays can be searched by trace ID.

💡 Motivation and Context

Fixes #3729 on iOS (Android shipped in #3744)

💚 How did you test it?

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPii is enabled
  • I updated the docs if needed
  • All tests passing
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec
  • No breaking changes

🔮 Next steps

Changelog Entry

  • Session Replays on iOS now include trace IDs, so they can be found by searching for a trace ID in Sentry

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>
@github-actions

Copy link
Copy Markdown
Contributor

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

  • packages/flutter/darwin/sentry_flutter/Sources/sentry_flutter/SentryFlutterPlugin.swift

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


Features

  • Session Replays on iOS now include trace IDs, so they can be found by searching for a trace ID in Sentry by antonis in #4083

Fixes

  • (app-start) Keep builds and deduplicate TTFD by buenaflor in #4079

Dependencies

Deps

  • chore(deps): update Native SDK to v0.17.3 by github-actions in #4082
  • chore(deps): update Native SDK to v0.17.2 by github-actions in #4031
  • chore(deps): update Cocoa SDK to v9.30.1 by github-actions in #4075
  • chore(deps): Update Android SDK to v8.60.0 by github-actions in #4077

🤖 This preview updates automatically when you update the PR.

@codecov

codecov Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.91%. Comparing base (5ae6c35) to head (db520f3).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

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     
Flag Coverage Δ
sentry ?
sentry_dio ?
sentry_drift ?
sentry_file ?
sentry_firebase_remote_config 100.00% <ø> (ø)
sentry_flutter 92.62% <ø> (ø)
sentry_grpc ?
sentry_hive ?
sentry_isar ?
sentry_link ?
sentry_logging ?
sentry_sqflite ?
sentry_supabase 97.48% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Android Performance metrics 🚀

  Plain With Sentry Diff
Startup time 371.32 ms 381.12 ms 9.80 ms
Size 14.77 MiB 16.08 MiB 1.31 MiB

Baseline results on branch: main

Startup times

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

Previous results on branch: feat/cocoa-replay-trace-ids

Startup times

Revision Plain With Sentry Diff
465ec81 367.80 ms 364.70 ms -3.10 ms

App size

Revision Plain With Sentry Diff
465ec81 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>

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

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

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1247.33 ms 1264.60 ms 17.26 ms
Size 5.91 MiB 6.35 MiB 450.23 KiB

Baseline results on branch: main

Startup times

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

Previous results on branch: feat/cocoa-replay-trace-ids

Startup times

Revision Plain With Sentry Diff
465ec81 1260.47 ms 1262.94 ms 2.47 ms

App size

Revision Plain With Sentry Diff
465ec81 5.91 MiB 6.35 MiB 450.24 KiB

@antonis
antonis marked this pull request as ready for review October 14, 2026 13:39

@buenaflor buenaflor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

@antonis
antonis enabled auto-merge (squash) October 14, 2026 13:54
@antonis
antonis merged commit b97602d into main Oct 14, 2026
70 checks passed
@antonis
antonis deleted the feat/cocoa-replay-trace-ids branch October 14, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Populate trace_ids in replay events to enable searching replays by trace ID

2 participants