Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firebase storage timeout doesn't work #6214

Open
jarvislin opened this issue Aug 26, 2024 · 1 comment
Open

Firebase storage timeout doesn't work #6214

jarvislin opened this issue Aug 26, 2024 · 1 comment
Labels
api: storage type: bug Something isn't working

Comments

@jarvislin
Copy link

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

Yes

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: Android Studio Koala | 2024.1.1 Patch 2
  • Firebase Component: Storage
  • Component version: com.google.firebase:firebase-storage:21.0.0

[REQUIRED] Step 3: Describe the problem

I implemented a feature that allows users to select a photo from the gallery and upload it to Firebase Storage. However, if I switch my phone to airplane mode (no internet) before selecting the photo, my Logcat continuously outputs the following log:

2024-08-26 14:43:03.625   720-862   StorageUtil             com.jarvislin.producepricechecker    W  Error getting App Check token; using placeholder token instead. Error: com.google.firebase.FirebaseException: No AppCheckProvider installed.
2024-08-26 14:43:04.837   720-862   ExponenentialBackoff    com.jarvislin.producepricechecker    W  network unavailable, sleeping.
2024-08-26 14:43:04.848   720-862   StorageUtil             com.jarvislin.producepricechecker    W  Error getting App Check token; using placeholder token instead. Error: com.google.firebase.FirebaseException: No AppCheckProvider installed.
2024-08-26 14:43:06.070   720-862   ExponenentialBackoff    com.jarvislin.producepricechecker    W  network unavailable, sleeping.
2024-08-26 14:43:06.082   720-862   StorageUtil             com.jarvislin.producepricechecker    W  Error getting App Check token; using placeholder token instead. Error: com.google.firebase.FirebaseException: No AppCheckProvider installed.
2024-08-26 14:43:07.230   720-862   ExponenentialBackoff    com.jarvislin.producepricechecker    W  network unavailable, sleeping.
2024-08-26 14:43:07.238   720-862   StorageUtil             com.jarvislin.producepricechecker    W  Error getting App Check token; using placeholder token instead. Error: com.google.firebase.FirebaseException: No AppCheckProvider installed.
...

I expected the addOnFailureListener to be triggered instead.

Steps to reproduce:

  1. Turn off the internet.
  2. Select a photo and upload it.

Relevant Code:

Firebase.storage("my_url")
            .apply { maxUploadRetryTimeMillis = 10000 }
            .reference.child(path)
            .putBytes(bytes)
            .addOnSuccessListener {  }
            .addOnFailureListener { /* This is not triggered */ }
            .addOnCanceledListener {  }
@lehcar09
Copy link
Contributor

Hi @jarvislin, thank you for reaching out. I was able to reproduce the issue. The issue occurs only when using putBytes(). I tried using the putFile() and putStream and the maxUploadRetryTimeMillis is followed accordingly.

Per checking, the putBytes() is using the maxDownloadRetryTimeMillis while the other upload API's is using maxUploadRetryTimeMillis.

new ExponentialBackoffSender(
storage.getApp().getApplicationContext(),
mAuthProvider,
mAppCheckProvider,
storage.getMaxDownloadRetryTimeMillis());

I'll inform our engineers about this and see what we can do here. Thanks!

@lehcar09 lehcar09 added the type: bug Something isn't working label Aug 26, 2024
lehcar09 added a commit to lehcar09/firebase-android-sdk that referenced this issue Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants
@jarvislin @google-oss-bot @lehcar09 and others