Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a crash related to thread sanitization on variables in FPRNetworkTrace class. #13795

Merged
merged 3 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions FirebasePerformance/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Pending
visumickey marked this conversation as resolved.
Show resolved Hide resolved
- [fixed] Fix a crash related to thread sanitization on FPRNetworkTrace class (#13581).

# 10.28.0
- Fix Crash from InstrumentUploadTaskWithStreamedRequest (#12983).
- Replace SystemConfiguration with a more recent network monitoring API by Apple (#13079).
Expand Down
12 changes: 9 additions & 3 deletions FirebasePerformance/Sources/Instrumentation/FPRNetworkTrace.m
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ - (NSTimeInterval)startTimeSinceEpoch {
#pragma mark - Overrides

- (void)setResponseCode:(int32_t)responseCode {
_responseCode = responseCode;
dispatch_sync(self.syncQueue, ^{
_responseCode = responseCode;
});
if (responseCode != 0) {
_hasValidResponseCode = YES;
}
Expand Down Expand Up @@ -279,7 +281,9 @@ - (void)didUploadFileWithURL:(NSURL *)URL {
}

- (void)didReceiveData:(NSData *)data {
self.responseSize = data.length;
dispatch_sync(self.syncQueue, ^{
self.responseSize = data.length;
});
}

- (void)didReceiveFileURL:(NSURL *)URL {
Expand All @@ -290,7 +294,9 @@ - (void)didReceiveFileURL:(NSURL *)URL {
if (error) {
FPRLogNotice(kFPRNetworkTraceFileError, @"Unable to determine the size of file.");
} else {
self.responseSize = value.unsignedIntegerValue;
dispatch_sync(self.syncQueue, ^{
self.responseSize = value.unsignedIntegerValue;
});
}
}
}
Expand Down
Loading