Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Firebase Storage - StorageTask cannot be canceled while the network connection is unavailable #3700

Open
@nikolajakshic

Description

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: Bumblebee 2021年1月1日 Patch 3
  • Firebase Component: Storage
  • Component version: firebase-storage:20.0.1

[REQUIRED] Step 3: Describe the problem

StorageTask cannot be canceled while the network connection is unavailable.

Relevant Code:

suspend fun reproduceBug() {
 // STEP 1 - turn off network connection (wifi/mobile)
 val task = FirebaseStorage.getInstance()
 .getReference("my-firebase-storage.json")
 .getFile(File("my-file-pathname"))
 task.addOnCanceledListener {
 // even though task.cancel() returns true,
 // listener will not be called until network connection gets established
 }
 task.addOnCompleteListener {
 // even though task.cancel() returns true,
 // listener will not be called until network connection gets established
 }
 delay(5000)
 val isCanceled = task.cancel() // returns true, but not canceled
}

StorageTask goes into 'canceling' state:


ExponentialBackoffSender is stuck in the while loop, wasting resources, until it hits max-wait-time or network connection is established, because 'cancel' is not yet called.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /