Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Unreleased
- Cancel upload operation when background task expires.

# v10.1.0
- Fix `[FBLPromise HTTPBody]` SwiftUI Previews crash when using binary
distribution. ([firebase-ios-sdk/#13318](https://github.com/firebase/firebase-ios-sdk/issues/13318),
Expand Down
5 changes: 3 additions & 2 deletions GoogleDataTransport/GDTCCTLibrary/GDTCCTUploadOperation.m
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,9 @@ - (void)uploadTarget:(GDTCORTarget)target withConditions:(GDTCORUploadConditions
beginBackgroundTaskWithName:@"GDTCCTUploader-upload"
expirationHandler:^{
if (backgroundTaskID != GDTCORBackgroundIdentifierInvalid) {
// Cancel the upload and complete delivery.
[self.currentTask cancel];
// Cancel the upload. The outgoing upload network request
// is not cancelled and may or may not complete delivery.
[self cancel];

// End the background task.
backgroundTaskCompletion();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ NS_ASSUME_NONNULL_BEGIN
/** The queue on which all CCT uploading will occur. */
@property(nonatomic, readonly) dispatch_queue_t uploaderQueue;

/** The current upload task. */
@property(nullable, nonatomic, readonly) NSURLSessionUploadTask *currentTask;

@end

NS_ASSUME_NONNULL_END
Loading