Skip to content

Commit 2e3ef92

Browse files
fix(replay): network breadcrumbs with tracing disabled were missing start timestamp (#4091)
Session replay should be independent of the tracing (performance).
1 parent 6956d43 commit 2e3ef92

File tree

3 files changed

+199
-167
lines changed

3 files changed

+199
-167
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
- `storeEnvelope` ends session for unhandled errors (#4073)
1414
- Deprecate `SentryUser.segment`(#4092). Please remove usages of this property. We will remove it in the next major.
15+
- Sentry Replay Network details should be available without Tracing (#4091)
1516

1617
## 8.29.1
1718

Sources/Sentry/SentryNetworkTracker.m

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,12 @@ - (void)urlSessionTaskResume:(NSURLSessionTask *)sessionTask
163163
return;
164164
}
165165

166+
// Register request start date in the sessionTask to use for breadcrumb
167+
if (self.isNetworkBreadcrumbEnabled) {
168+
objc_setAssociatedObject(sessionTask, &SENTRY_NETWORK_REQUEST_START_DATE, [NSDate date],
169+
OBJC_ASSOCIATION_RETAIN_NONATOMIC);
170+
}
171+
166172
@synchronized(self) {
167173
if (!self.isNetworkTrackingEnabled) {
168174
[self addTraceWithoutTransactionToTask:sessionTask];
@@ -220,10 +226,6 @@ - (void)urlSessionTaskResume:(NSURLSessionTask *)sessionTask
220226
@"SentryNetworkTracker automatically started HTTP span for sessionTask: %@",
221227
netSpan.description);
222228

223-
// Register request start date in the sessionTask to use for breadcrumb
224-
objc_setAssociatedObject(sessionTask, &SENTRY_NETWORK_REQUEST_START_DATE, [NSDate date],
225-
OBJC_ASSOCIATION_RETAIN_NONATOMIC);
226-
227229
objc_setAssociatedObject(sessionTask, &SENTRY_NETWORK_REQUEST_TRACKER_SPAN, netSpan,
228230
OBJC_ASSOCIATION_RETAIN_NONATOMIC);
229231
}

0 commit comments

Comments
 (0)