Skip to content

Commit

Permalink
Merge 79fcb22 into 8001609
Browse files Browse the repository at this point in the history
  • Loading branch information
krystofwoldrich authored Jun 20, 2024
2 parents 8001609 + 79fcb22 commit 4f065e3
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 79 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Fixes

- `storeEnvelope` ends session for unhandled errors (#4073)
- Sentry Replay Network details should be available without Tracing (#4091)

## 8.29.1

Expand Down
8 changes: 4 additions & 4 deletions Sources/Sentry/SentryNetworkTracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ - (void)urlSessionTaskResume:(NSURLSessionTask *)sessionTask
return;
}

// Register request start date in the sessionTask to use for breadcrumb
objc_setAssociatedObject(sessionTask, &SENTRY_NETWORK_REQUEST_START_DATE, [NSDate date],
OBJC_ASSOCIATION_RETAIN_NONATOMIC);

@synchronized(self) {
if (!self.isNetworkTrackingEnabled) {
[self addTraceWithoutTransactionToTask:sessionTask];
Expand Down Expand Up @@ -220,10 +224,6 @@ - (void)urlSessionTaskResume:(NSURLSessionTask *)sessionTask
@"SentryNetworkTracker automatically started HTTP span for sessionTask: %@",
netSpan.description);

// Register request start date in the sessionTask to use for breadcrumb
objc_setAssociatedObject(sessionTask, &SENTRY_NETWORK_REQUEST_START_DATE, [NSDate date],
OBJC_ASSOCIATION_RETAIN_NONATOMIC);

objc_setAssociatedObject(sessionTask, &SENTRY_NETWORK_REQUEST_TRACKER_SPAN, netSpan,
OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
Expand Down
Loading

0 comments on commit 4f065e3

Please sign in to comment.