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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Unreleased
- Fix `EXC_BAD_ACCESS` crash in `GDTCORLogAssert` when a user's project path contains `%` characters. ([#16455](https://github.com/firebase/firebase-ios-sdk/issues/16455))
- Fix test flakiness in `GDTCCTIntegrationTest` and `GDTCCTUploaderTest` related to background task cancellation.
- Cancel upload operation when background task expires.
- Log error when handling directory enumeration.

Expand Down
4 changes: 4 additions & 0 deletions GoogleDataTransport/GDTCCTLibrary/GDTCCTUploadOperation.m
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,10 @@ - (void)finishOperation {
}

- (void)start {
if (self.isCancelled) {
[self finishOperation];
return;
}
[self startOperation];

GDTCORLogDebug(@"Upload operation started: %@", self);
Expand Down
2 changes: 2 additions & 0 deletions GoogleDataTransport/GDTCCTLibrary/GDTCCTUploader.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@

@interface GDTCCTUploader () <NSURLSessionDelegate, GDTCCTUploadMetadataProvider>

#if !GDT_TEST
@property(nonatomic, readonly) NSOperationQueue *uploadOperationQueue;
#endif
@property(nonatomic, readonly) dispatch_queue_t uploadQueue;

@property(nonatomic, readonly)
Expand Down
3 changes: 3 additions & 0 deletions GoogleDataTransport/GDTCCTLibrary/Private/GDTCCTUploader.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ NS_ASSUME_NONNULL_BEGIN
/** An upload URL used across all targets. For testing only. */
@property(class, nullable, nonatomic) NSURL *testServerURL;

/** The queue on which upload operations run. For testing only. */
@property(nonatomic, readonly) NSOperationQueue *uploadOperationQueue;

/** Spins runloop until upload finishes or timeout.
* @return YES if upload finishes, NO in the case of timeout.
*/
Expand Down
Comment thread
paulb777 marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ @interface GDTCCTIntegrationTest : XCTestCase
@implementation GDTCCTIntegrationTest

- (void)setUp {
// Cancel pending operations from previous tests and wait for them to finish.
[[GDTCCTUploader sharedInstance].uploadOperationQueue cancelAllOperations];
[[GDTCCTUploader sharedInstance] waitForUploadFinishedWithTimeout:5];

// Make sure clean storage state before start.
[[GDTCORFlatFileStorage sharedInstance] reset];

Expand Down
Loading