Conversation
Read replay IDs from the active integration so hybrid SDKs can associate telemetry while Session Replay is buffering. Expose the buffering mode separately so consumers can mark buffered replay associations correctly. Document the behavior change for hybrid SDK upgrades.
|
|
@buenaflor Turns out we did not have the API on the cocoa side we need. We could also add this to v10 sentry instead, as this is a breaking change for hybrid SDKs. |
|
@denrase doing this in v10 is also fine for me |
|
@philprime Would you agree that this also fits more in v10 cocoa, as it is a breaking change for hybrid SDKs? |
Keep the v9 replay ID scope-based and expose buffering state only in v10. Move the changelog entry and public API snapshots to the v10 variants.
📲 Install BuildsiOS
|
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| be4ef1e | 1226.57 ms | 1259.87 ms | 33.30 ms |
| 4f45d12 | 1222.45 ms | 1260.36 ms | 37.91 ms |
| b69e199 | 1210.45 ms | 1251.13 ms | 40.68 ms |
| 49cc12d | 1227.33 ms | 1263.21 ms | 35.89 ms |
| a29e132 | 1225.98 ms | 1258.31 ms | 32.34 ms |
| fd08fa6 | 1213.43 ms | 1256.65 ms | 43.22 ms |
| 6b08499 | 1216.67 ms | 1247.76 ms | 31.08 ms |
| faafa93 | 1214.88 ms | 1248.02 ms | 33.14 ms |
| 53773e2 | 1226.96 ms | 1261.50 ms | 34.54 ms |
| ed33915 | 1231.46 ms | 1259.48 ms | 28.02 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| be4ef1e | 24.14 KiB | 1.23 MiB | 1.21 MiB |
| 4f45d12 | 24.14 KiB | 1.29 MiB | 1.27 MiB |
| b69e199 | 24.14 KiB | 1.24 MiB | 1.22 MiB |
| 49cc12d | 24.14 KiB | 1.16 MiB | 1.13 MiB |
| a29e132 | 24.14 KiB | 1.18 MiB | 1.15 MiB |
| fd08fa6 | 24.14 KiB | 1.26 MiB | 1.23 MiB |
| 6b08499 | 24.14 KiB | 1.15 MiB | 1.13 MiB |
| faafa93 | 24.14 KiB | 1.29 MiB | 1.27 MiB |
| 53773e2 | 24.14 KiB | 1.23 MiB | 1.21 MiB |
| ed33915 | 24.14 KiB | 1.20 MiB | 1.17 MiB |
NinjaLikesCheez
left a comment
There was a problem hiding this comment.
LGTM, couple comments nothing blocking
| @@ -9,11 +9,15 @@ public struct SentryInternalReplayApi { | |||
|
|
|||
| typealias Dependencies = HubProvider & ReplayIntegrationProviderProvider | |||
There was a problem hiding this comment.
m: should HubProvider be guarded with !SDK_V10 too?
| state.isFullSession = true | ||
| return state.sessionReplayId | ||
| } | ||
| guard let replayId = replayId else { return } |
There was a problem hiding this comment.
l:
| guard let replayId = replayId else { return } | |
| guard let replayId else { return } |
| let replay = sessionReplayReference.withLock { replay in | ||
| defer { replay = nil } | ||
| return replay | ||
| } | ||
| replay?.pause() | ||
| removeBackgroundForegroundObservers() |
There was a problem hiding this comment.
Is there a reason not to call pause() inside the lock? The pattern is fine, it just reads a little odd so I thought I'd ask as I'm not sure :)
|
Put this back to draft, as it most likely needs re-evaluation in light of new Start/Stop APIs. Linking PRs below for context. |
📜 Description
replayIdfrom the active Session Replay integration so it is available in session and buffer modes.isBufferingthrough the Swift and Objective-C hybrid SDK APIs in V10.💡 Motivation and Context
Hybrid SDKs need the active replay ID to associate logs, metrics, and spans while Session Replay is buffering. Buffered associations must also include
sentry._internal.replay_is_buffering = true, because the replay may never be captured and uploaded.In V10, a non-
nilreplayIdtherefore no longer implies that a full-session replay is running or that a buffered replay was captured. Hybrid SDKs upgrading to V10 must consumeisBufferingalongsidereplayIdand must not write buffered IDs to scope. V9 remains unchanged.Related Dart migration issue: getsentry/sentry-dart#3796
💚 How did you test it?
make formatmake analyzemake generate-public-api📝 Checklist
sendDefaultPIIis enabled.#skip-changelog