firebase-android-sdk icon indicating copy to clipboard operation
firebase-android-sdk copied to clipboard

Storage upload timeout doesn't trigger call to OnFailureListener.onFailure()

Open davidkiss opened this issue 7 years ago • 4 comments

[READ] Step 1: Are you in the right place?

Issues filed here should be about bugs in the code in this repository. If you have a general question, need help debugging, or fall into some other category use one of these other channels:

  • For general technical questions, post a question on StackOverflow with the firebase tag.
  • For general Firebase discussion, use the firebase-talk google group.
  • For help troubleshooting your application that does not fall under one of the above categories, reach out to the personalized Firebase support channel.

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: 3.3___
  • Firebase Component: Storage___ (Database, Firestore, Storage, Functions, etc)
  • Component version: 16.1.0___

[REQUIRED] Step 3: Describe the problem

Once maxUploadRetryTimeMillis is reached, upload will halt, but it should also trigger a call to OnFailureListener.onFailure(). Otherwise there's no way for the mobile app to know that the timeout happened.

Steps to reproduce:

  1. Start uploading a file to Firebase storage using UploadTask
  2. Add OnFailureListener to UploadTask to log any failures during upload
  3. Once a few chunks were uploaded, turnoff internet connection on computer
  4. Wait for timeout (default is 10 minutes, but can be customized by using FirebaseStorage.getInstance().getReference().getStorage().setMaxUploadRetryTimeMillis(1000L))
  5. Restore internet connection on the computer
  6. Notice the upload doesn't continue, but there are no failures logged by the OnFailureListener

What happened? How can we make the problem occur? This could be a description, log/console output, etc.

Relevant Code:

// TODO(you): code here to reproduce the problem

davidkiss avatar Mar 28 '19 15:03 davidkiss

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Mar 28 '19 15:03 google-oss-bot

Thanks for the bug report. I'm not sure when we'll be able to investigate this, but if anybody wants to put together a Pull Request, we'd be happy to take a look. Thanks!

mikelehen avatar Mar 28 '19 15:03 mikelehen

OMG, To me also the same thing happened. Even my question looks like. How can I lower the timeout in uploading a file to Firebase and in which listener I detect it? . I tried it by setting the firebaseStorage.setMaxUploadRetryTimeMillis (5000) method (5 seconds) but it does not seem to work.

brianbritto avatar Jul 11 '19 15:07 brianbritto

Thanks for your patience. Please feel free to reopen if you have a PR that can help address this.

ashwinraghav avatar Jun 09 '20 18:06 ashwinraghav