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] put file await never resolves #5106

Closed
andy-t-wang opened this issue Feb 23, 2021 · 9 comments
Closed

🐛 [firebase_storage] put file await never resolves #5106

andy-t-wang opened this issue Feb 23, 2021 · 9 comments
Labels
Needs Attention This issue needs maintainer attention. type: bug Something isn't working

Comments

@andy-t-wang
Copy link

andy-t-wang commented Feb 23, 2021

Bug report

Describe the bug
Await putfile will place the file in my firebase storage but the await will never resolve the code just gets stuck there and won't continue. Using firebase_storage 7.0.0

Steps to reproduce

Running this in debug mode on my physical device

This is my code a very simple implementation. When I access my dashboard I see the file gets put in there and can open it with no issues, however, my code will not resolve the await and the done will never be printed.

void uploadImage(String path) async {
    final _storage = FirebaseStorage.instance;
    var file = File(path);
    var snapshot = await _storage.ref().child('folderName/imageName').putFile(file);

    // var downloadUrl = await snapshot.ref.getDownloadURL();

    print('done');
  }

Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand
[✓] Flutter (Channel stable, 1.22.6, on macOS 11.2.1 20D74 darwin-x64, locale en-US)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 12.4).
[✓] VS Code (version 1.53.2)
[✓] Connected device (1 available)

@andy-t-wang andy-t-wang added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Feb 23, 2021
@markusaksli-nc
Copy link
Contributor

Hi @andy-t-wang
Are any error or exception messages thrown? Could you please provide your flutter pub deps -- --style=compact?
Thank you

@markusaksli-nc markusaksli-nc added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels Feb 23, 2021
@andy-t-wang
Copy link
Author

Dart SDK 2.10.5
Flutter SDK 1.22.6
storio 1.0.0+1

dependencies:
- audio_service 0.16.2 [audio_session rxdart flutter_isolate flutter_cache_manager sqflite js flutter flutter_web_plugins]
- auto_size_text 2.1.0 [flutter]
- cupertino_icons 0.1.3
- file_picker 2.1.6 [flutter flutter_web_plugins flutter_plugin_android_lifecycle plugin_platform_interface]
- firebase_core 0.7.0 [firebase_core_platform_interface flutter quiver meta firebase_core_web]
- firebase_storage 7.0.0 [flutter firebase_core firebase_core_platform_interface firebase_storage_web firebase_storage_platform_interface quiver]
- flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine]
- flutter_easyloading 2.2.2 [flutter flutter_spinkit]
- flutter_svg 0.19.1 [flutter meta path_drawing vector_math xml]
- just_audio 0.6.12 [just_audio_platform_interface just_audio_web audio_session rxdart path path_provider async uuid crypto meta flutter]
- permission_handler 5.1.0+2 [flutter meta permission_handler_platform_interface]
- provider 4.3.3 [collection flutter nested]

dev dependencies:
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher meta source_span stream_channel string_scanner term_glyph typed_data]

transitive dependencies:
- archive 2.0.13 [crypto args path]
- args 1.6.0
- async 2.5.0-nullsafety.1 [collection]
- audio_session 0.0.11 [flutter flutter_web_plugins rxdart]
- boolean_selector 2.1.0-nullsafety.1 [source_span string_scanner]
- characters 1.1.0-nullsafety.3
- charcode 1.2.0-nullsafety.1
- clock 1.1.0-nullsafety.1
- collection 1.15.0-nullsafety.3
- convert 2.1.1 [charcode typed_data]
- crypto 2.1.5 [collection convert typed_data]
- fake_async 1.2.0-nullsafety.1 [clock collection]
- ffi 0.1.3
- file 5.2.1 [intl meta path]
- firebase_core_platform_interface 3.0.1 [flutter meta plugin_platform_interface quiver]
- firebase_core_web 0.2.1+3 [firebase_core_platform_interface flutter flutter_web_plugins meta js]
- firebase_storage_platform_interface 1.0.4 [flutter meta collection firebase_core plugin_platform_interface]
- firebase_storage_web 0.1.1+3 [async crypto firebase_core firebase_core_web firebase_storage_platform_interface flutter flutter_web_plugins http js meta]
- flutter_cache_manager 2.1.1 [flutter path_provider uuid http path sqflite pedantic clock file rxdart image]
- flutter_isolate 1.0.0+14 [flutter uuid]
- flutter_plugin_android_lifecycle 1.0.11 [flutter]
- flutter_spinkit 4.1.2+1 [flutter]
- flutter_web_plugins 0.0.0 [flutter characters collection meta typed_data vector_math]
- http 0.12.2 [http_parser path pedantic]
- http_parser 3.1.4 [charcode collection source_span string_scanner typed_data]
- image 2.1.19 [archive xml meta]
- intl 0.16.1 [path]
- js 0.6.2
- just_audio_platform_interface 2.0.0 [flutter meta plugin_platform_interface]
- just_audio_web 0.2.3 [just_audio_platform_interface flutter flutter_web_plugins meta]
- matcher 0.12.10-nullsafety.1 [stack_trace]
- meta 1.3.0-nullsafety.3
- nested 0.0.4 [flutter]
- path 1.8.0-nullsafety.1
- path_drawing 0.4.1+1 [vector_math meta path_parsing flutter]
- path_parsing 0.1.4 [vector_math meta]
- path_provider 1.6.27 [flutter path_provider_platform_interface path_provider_macos path_provider_linux path_provider_windows]
- path_provider_linux 0.0.1+2 [path xdg_directories path_provider_platform_interface flutter]
- path_provider_macos 0.0.4+8 [flutter]
- path_provider_platform_interface 1.0.4 [flutter meta platform plugin_platform_interface]
- path_provider_windows 0.0.4+3 [path_provider_platform_interface meta path flutter ffi win32]
- pedantic 1.9.2 [meta]
- permission_handler_platform_interface 2.0.2 [flutter meta plugin_platform_interface]
- petitparser 3.1.0 [meta]
- platform 2.2.1
- plugin_platform_interface 1.0.3 [meta]
- process 3.0.13 [file intl meta path platform]
- quiver 2.1.5 [matcher meta]
- rxdart 0.25.0
- sky_engine 0.0.99
- source_span 1.8.0-nullsafety.2 [charcode collection path term_glyph]
- sqflite 1.3.2+3 [flutter sqflite_common path]
- sqflite_common 1.0.3+1 [synchronized path meta]
- stack_trace 1.10.0-nullsafety.1 [path]
- stream_channel 2.1.0-nullsafety.1 [async]
- string_scanner 1.1.0-nullsafety.1 [charcode source_span]
- synchronized 2.2.0+2
- term_glyph 1.2.0-nullsafety.1
- test_api 0.2.19-nullsafety.2 [async boolean_selector collection meta path source_span stack_trace stream_channel string_scanner term_glyph matcher]
- typed_data 1.3.0-nullsafety.3 [collection]
- uuid 2.2.2 [crypto convert]
- vector_math 2.1.0-nullsafety.3
- win32 1.7.4+1 [ffi]
- xdg_directories 0.1.2 [meta path process]
- xml 4.5.1 [collection convert meta petitparser]

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels Feb 23, 2021
@andy-t-wang
Copy link
Author

andy-t-wang commented Feb 23, 2021

I think it has to do with using audio service as specified in this issue seems like a bug in firebase storage still but it was fixed for firestore. Is there any work around to this or eta when the storage library will be fixed? There is no error message the await just hangs however mine is running in the foreground when it hangs.
#4513

@andy-t-wang
Copy link
Author

Btw if anyone runs into this the current work around I'm doing is just not await the put file. Then having a recurring 5 second delay that trys to get the download URL to see if the file is done uploading. If it is then it returns the string back up or if it recurses more than 15 times so waits 75 seconds I just return an error

@dipakp2726
Copy link

dipakp2726 commented Feb 24, 2021

HI ,
you can listen for snapshot events and notice progress in uploadTask to see whats Progress made

@andy-t-wang
Copy link
Author

That did not work, I'm assuming it's because I cannot await the task

@markusaksli-nc
Copy link
Contributor

Since this also has to do with audio_service then I'm going to close this as a duplicate of #4513

Having that open to track the issue should be enough.

@andy-t-wang
Copy link
Author

andy-t-wang commented Mar 16, 2021

@ened Here's the problem. Right now when you have audio service running as well the await never finishes when you put a file into storage. The code just hangs there

@firebase firebase locked and limited conversation to collaborators Mar 28, 2021
@firebase firebase unlocked this conversation Apr 21, 2021
@ened
Copy link
Contributor

ened commented Apr 21, 2021

@andy-t-wang Thank you for the pointer. We will track the underlying issue in #4513.

@firebase firebase locked and limited conversation to collaborators Apr 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs Attention This issue needs maintainer attention. type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants