Skip to content

Assert DownloadTask enqueueWithData not on main thread #1302

Closed
@portellaa

Description

@portellaa
  • Xcode version: 9.3.1
  • Firebase SDK version: 5.0.1
  • Firebase Component: Storage
  • Component version: 3.0.0

Steps to reproduce:

Before Firebase SDK 5.0 and Storage 3.0 we use to download data from Storage in a background thread, or at least we assume so, because we configure the callbackQueue property with queue create by us with .background QoS.

This is my code to configure the Firebase Storage component:

private func setupFirebaseStorage() -> Storage {
    let firebaseStorage = Storage.storage()
    let queue = DispatchQueue(label: "queue.firebase.storage".reverseDomain,
                              qos: .background)

    firebaseStorage.callbackQueue = queue

    return firebaseStorage
}

After the upgrade to Storage v3.0, the application started to stop in the assert in the FIRStorageDownloadTask.m in the method - (void)enqueueWithData:(nullable NSData *)resumeData which didn't happened in the previous version of the SDK.

Although, i believe that now is the expected behaviour, but is this correct? Is this something that you want, use the main thread for this? From my point of view, this is a developer responsibility, when the SDK delivers the data on the completion closure.

Relevant Code:

private func setupFirebaseStorage() -> Storage {
    let firebaseStorage = Storage.storage()
    let queue = DispatchQueue(label: "queue.firebase.storage".reverseDomain,
                              qos: .background)

    firebaseStorage.callbackQueue = queue

    return firebaseStorage
}

Call getData(maxSize: Int64) on a StorageReference to get data for a specific path.

If you need more information, please just ask.
🍻

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions