firebase / flutterfire

πŸ”₯ A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.68k stars 3.97k forks source link

πŸ› [firebase_storage] Very rare TaskState.running snapshotEvents received while uploading #3716

Closed yanivshaked closed 4 years ago

yanivshaked commented 4 years ago

Bug report

While uploading a file to firebase storage, I'm listening to snapshotevents of TaskState.running type to display a progress bar while file is being uploaded. Problem is that the time interval between such events is very long and doubles itself as file is being uploaded.

Steps to reproduce

Steps to reproduce the behavior:

  1. Initiate an upload.
  2. Register for snapshotevents.
  3. Print a message to console on each event of TaskState.running type.

Expected behavior

High resolution events, (which exist for download, but not for upload).


Here is the output I'm getting, you can see that TaskState.running event are too rare for a 3.5Mb file.

I/System.out( 9872): (HTTPLog)-Static: isSBSettingEnabled false D/UploadTask( 9872): Increasing chunk size to 524288 I/flutter ( 9872): Upload: TaskState.running 262144/3531760)=0.07422474913357646 I/System.out( 9872): (HTTPLog)-Static: isSBSettingEnabled false I/System.out( 9872): (HTTPLog)-Static: isSBSettingEnabled false D/UploadTask( 9872): Increasing chunk size to 1048576 I/flutter ( 9872): Upload: TaskState.running 786432/3531760)=0.22267424740072939 I/System.out( 9872): (HTTPLog)-Static: isSBSettingEnabled false I/System.out( 9872): (HTTPLog)-Static: isSBSettingEnabled false D/UploadTask( 9872): Increasing chunk size to 2097152 I/flutter ( 9872): Upload: TaskState.running 1835008/3531760)=0.5195732439350352 I/System.out( 9872): (HTTPLog)-Static: isSBSettingEnabled false I/System.out( 9872): (HTTPLog)-Static: isSBSettingEnabled false I/flutter ( 9872): Upload: TaskState.running 3531760/3531760)=1.0


Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand ``` [√] Flutter (Channel stable, 1.20.4, on Microsoft Windows [Version 10.0.18363.1082], locale en-IL) β€’ Flutter version 1.20.4 at C:\src\flutter β€’ Framework revision fba99f6cf9 (2 weeks ago), 2020-09-14 15:32:52 -0700 β€’ Engine revision d1bc06f032 β€’ Dart version 2.9.2 [√] Android toolchain - develop for Android devices (Android SDK version 30.0.2) β€’ Android SDK at C:\Users\shake\AppData\Local\Android\sdk β€’ Platform android-30, build-tools 30.0.2 β€’ Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java β€’ Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) β€’ All Android licenses accepted. [√] Android Studio (version 4.0) β€’ Android Studio at C:\Program Files\Android\Android Studio β€’ Flutter plugin version 49.0.2 β€’ Dart plugin version 193.7547 β€’ Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) [√] VS Code (version 1.49.2) β€’ VS Code at C:\Users\shake\AppData\Local\Programs\Microsoft VS Code β€’ Flutter extension version 3.14.1 [√] Connected device (1 available) β€’ SM G950F (mobile) β€’ ce041714ca5a1e0402 β€’ android-arm64 β€’ Android 9 (API 28) β€’ No issues found! ```

Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand ``` Dart SDK 2.9.2 Flutter SDK 1.20.4 tw_app 0.4.12+722 dependencies: - ansicolor 1.0.5 - app_settings 4.0.4 [flutter] - autocomplete_textfield 1.7.3 [flutter] - bubble 1.1.9+1 [flutter] - cached_network_image 2.2.0+1 [flutter flutter_cache_manager] - connectivity 0.4.9+3 [flutter meta connectivity_platform_interface connectivity_macos connectivity_for_web] - contacts_service 0.4.6 [flutter collection quiver] - dashed_circle 0.0.1 [flutter] - device_info 0.4.2+8 [flutter device_info_platform_interface] - device_preview 0.4.8 [font_awesome_flutter http freezed_annotation json_annotation flutter flutter_localizations meta shared_preferences shared_preferences_macos] - devicelocale 0.3.2 [flutter] - equatable 1.2.5 [collection meta] - expandable 4.1.4 [flutter] - firebase_auth 0.18.0+1 [meta firebase_core firebase_core_platform_interface firebase_auth_platform_interface firebase_auth_web flutter] - firebase_core 0.5.0 [firebase_core_platform_interface flutter quiver meta firebase_core_web] - firebase_messaging 7.0.0 [meta platform flutter firebase_core] - firebase_storage 5.0.0-dev.1 [flutter firebase_core firebase_core_platform_interface firebase_storage_platform_interface quiver] - fixnum 0.10.11 - flushbar 1.10.4 [flutter] - flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine] - flutter_absolute_path 1.0.6 [flutter] - flutter_better_camera 0.6.1 [flutter] - flutter_bloc 4.0.0 [flutter bloc provider] - flutter_html 1.0.0 [html csslib css_colors video_player chewie webview_flutter chewie_audio flutter_svg flutter] - flutter_local_notifications 1.4.4+4 [flutter platform flutter_local_notifications_platform_interface] - flutter_localizations 0.0.0 [flutter intl characters collection meta path typed_data vector_math] - flutter_secure_storage 3.3.3 [meta flutter] - flutter_sim_country_code 0.0.3 [flutter] - flutter_slidable 0.5.7 [flutter] - flutter_svg 0.17.4 [path_drawing xml vector_math meta flutter] - fluttertoast 7.1.1 [flutter flutter_web_plugins] - gbk2utf8 1.0.1 [flutter] - get_it 4.0.4 [async meta] - http 0.12.2 [http_parser path pedantic] - image 2.1.12 [archive xml] - intl 0.16.1 [path] - ios_app_group 1.0.2 [flutter] - json_serializable 3.5.0 [analyzer build build_config json_annotation meta path source_gen] - multi_image_picker 4.7.15 [flutter meta] - mutex 1.1.0 - native_device_orientation 0.4.3 [flutter] - ntp 1.0.7 [universal_io] - package_info 0.4.3 [flutter] - path_provider 1.6.18 [flutter path_provider_platform_interface path_provider_macos path_provider_linux path_provider_windows] - pdf_flutter 1.1.3 [flutter pedantic path_provider flutter_cache_manager http uuid] - permission_handler 5.0.1+1 [flutter meta permission_handler_platform_interface] - phone_number 0.6.2+4 [flutter] - photo_view 0.10.2 [flutter] - pin_code_fields 3.1.2 [flutter] - receive_sharing_intent 1.4.1 [flutter] - reorderables 0.3.2 [flutter] - rxdart 0.24.1 - scroll_to_index 1.0.6 [flutter] - scrollable_positioned_list 0.1.7 [flutter meta] - share_extend 1.1.9 [meta flutter] - shared_preferences_app_group_ios 0.0.3 [flutter] - sliding_sheet 0.4.0 [flutter] - soundpool 1.1.2 [flutter soundpool_platform_interface soundpool_web soundpool_macos] - sprintf 5.0.0 - sqfentity 1.4.0+1 [flutter sqflite synchronized path sqfentity_gen sqflite_common_ffi] - sqfentity_gen 1.4.0 [build source_gen] - sqflite 1.3.1+1 [flutter sqflite_common path] - sticky_headers 0.1.8+1 [flutter meta] - tuple 1.0.3 [quiver] - url_launcher 5.7.2 [flutter url_launcher_platform_interface url_launcher_web url_launcher_linux url_launcher_macos url_launcher_windows] - uuid 2.2.2 [crypto convert] - vibration 1.5.0 [flutter] - video_player 0.10.12+5 [meta video_player_platform_interface video_player_web flutter] - video_thumbnail 0.2.2 [flutter] - web_socket_channel 1.1.0 [async crypto stream_channel] dev dependencies: - build_runner 1.10.1 [analyzer args async build build_config build_daemon build_resolvers build_runner_core code_builder collection crypto dart_style glob graphs http_multi_server io js logging meta mime path pedantic pool pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web_socket_channel yaml] - build_verify 1.1.1 [path test] - dependency_validator 1.5.0 [args logging path pub_semver yaml] - flutter_driver 0.0.0 [file json_rpc_2 meta path web_socket_channel vm_service_client webdriver flutter flutter_test fuchsia_remote_debug_protocol archive args async boolean_selector characters charcode clock collection convert crypto fake_async intl matcher platform process pub_semver source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api typed_data vector_math] - flutter_launcher_icons 0.7.5 [image args yaml] - 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] - test 1.15.2 [analyzer async boolean_selector coverage http http_multi_server io js node_preamble package_config path pedantic pool shelf shelf_packages_handler shelf_static shelf_web_socket source_span stack_trace stream_channel typed_data web_socket_channel webkit_inspection_protocol yaml test_api test_core] transitive dependencies: - _fe_analyzer_shared 6.0.0 [meta] - analyzer 0.39.14 [_fe_analyzer_shared args charcode cli_util collection convert crypto glob html meta package_config path pub_semver source_span watcher yaml] - archive 2.0.13 [crypto args path] - args 1.6.0 - async 2.4.2 [collection] - bloc 4.0.0 [meta] - boolean_selector 2.0.0 [source_span string_scanner] - build 1.3.0 [analyzer async convert crypto logging meta path glob] - build_config 0.4.2 [checked_yaml json_annotation meta path pubspec_parse yaml] - build_daemon 2.1.4 [built_collection built_value http_multi_server logging pedantic path pool shelf shelf_web_socket stream_transform watcher web_socket_channel] - build_resolvers 1.3.11 [analyzer build crypto graphs logging path package_config pub_semver] - build_runner_core 6.0.1 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta path package_config pedantic pool timing watcher yaml] - built_collection 4.3.2 [collection quiver] - built_value 7.1.0 [built_collection collection fixnum quiver] - characters 1.0.0 - charcode 1.1.3 - checked_yaml 1.0.2 [json_annotation source_span yaml] - chewie 0.9.10 [open_iconic_flutter video_player wakelock flutter] - chewie_audio 1.0.0+1 [open_iconic_flutter video_player screen flutter] - cli_util 0.1.4 [path] - clock 1.0.1 [meta] - code_builder 3.4.1 [built_collection built_value collection matcher meta] - collection 1.14.13 - connectivity_for_web 0.3.1+2 [connectivity_platform_interface flutter_web_plugins flutter] - connectivity_macos 0.1.0+5 [flutter] - connectivity_platform_interface 1.0.6 [flutter meta plugin_platform_interface] - convert 2.1.1 [charcode typed_data] - coverage 0.13.11 [args logging package_config path source_maps stack_trace vm_service] - crypto 2.1.5 [collection convert typed_data] - css_colors 1.0.2 [flutter] - csslib 0.16.2 [source_span] - dart_style 1.3.6 [analyzer args path source_span] - device_info_platform_interface 1.0.1 [flutter meta plugin_platform_interface] - fake_async 1.1.0 [clock collection] - ffi 0.1.3 - file 5.2.1 [intl meta path] - firebase 7.3.0 [http http_parser js] - firebase_auth_platform_interface 2.0.1 [flutter meta firebase_core plugin_platform_interface] - firebase_auth_web 0.3.0+1 [flutter flutter_web_plugins firebase meta http_parser intl firebase_core firebase_auth_platform_interface js] - firebase_core_platform_interface 2.0.0 [flutter meta plugin_platform_interface quiver] - firebase_core_web 0.2.0 [firebase firebase_core_platform_interface flutter flutter_web_plugins meta js] - firebase_storage_platform_interface 1.0.0-dev.1 [flutter meta collection firebase_core plugin_platform_interface] - flutter_cache_manager 1.4.2 [flutter path_provider uuid http path sqflite pedantic clock file rxdart] - flutter_local_notifications_platform_interface 1.0.1 [flutter plugin_platform_interface] - flutter_web_plugins 0.0.0 [flutter characters collection meta typed_data vector_math] - font_awesome_flutter 8.8.1 [flutter] - freezed_annotation 0.11.0+1 [collection json_annotation meta] - fuchsia_remote_debug_protocol 0.0.0 [json_rpc_2 process web_socket_channel flutter_test flutter_driver archive args async boolean_selector charcode clock collection convert crypto fake_async file intl matcher meta path platform pub_semver source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api typed_data vector_math vm_service_client webdriver] - glob 1.2.0 [async collection node_io path pedantic string_scanner] - graphs 0.2.0 - html 0.14.0+3 [csslib source_span] - http_multi_server 2.2.0 [async] - http_parser 3.1.4 [charcode collection source_span string_scanner typed_data] - io 0.3.4 [charcode meta path string_scanner] - js 0.6.2 - json_annotation 3.1.0 - json_rpc_2 2.2.1 [stack_trace stream_channel] - logging 0.11.4 - matcher 0.12.8 [stack_trace] - meta 1.1.8 - mime 0.9.7 - nested 0.0.4 [flutter] - node_interop 1.1.1 [js] - node_io 1.1.1 [node_interop path] - node_preamble 1.4.12 - open_iconic_flutter 0.3.0 [flutter] - package_config 1.9.3 [path charcode] - package_resolver 1.0.10 [collection http package_config path] - path 1.7.0 - path_drawing 0.4.1+1 [vector_math meta path_parsing flutter] - path_parsing 0.1.4 [vector_math meta] - path_provider_linux 0.0.1+2 [path xdg_directories path_provider_platform_interface flutter] - path_provider_macos 0.0.4+4 [flutter] - path_provider_platform_interface 1.0.3 [flutter meta platform plugin_platform_interface] - path_provider_windows 0.0.4+1 [path_provider_platform_interface meta path flutter ffi win32] - pedantic 1.9.0 - permission_handler_platform_interface 2.0.1 [flutter meta plugin_platform_interface] - petitparser 2.4.0 [meta] - platform 2.2.1 - plugin_platform_interface 1.0.2 [meta] - pool 1.4.0 [async stack_trace] - process 3.0.13 [file intl meta path platform] - provider 4.3.2+2 [flutter nested collection] - pub_semver 1.4.4 [collection] - pubspec_parse 0.1.5 [checked_yaml json_annotation pub_semver yaml] - quiver 2.1.3 [matcher meta] - screen 0.0.5 [flutter] - shared_preferences 0.5.12 [meta flutter shared_preferences_platform_interface shared_preferences_linux shared_preferences_macos shared_preferences_web shared_preferences_windows] - shared_preferences_linux 0.0.2+2 [file flutter meta path path_provider_linux shared_preferences_platform_interface] - shared_preferences_macos 0.0.1+10 [shared_preferences_platform_interface flutter] - shared_preferences_platform_interface 1.0.4 [meta flutter] - shared_preferences_web 0.1.2+7 [shared_preferences_platform_interface flutter flutter_web_plugins meta] - shared_preferences_windows 0.0.1+1 [shared_preferences_platform_interface flutter ffi file meta path path_provider_platform_interface path_provider_windows] - shelf 0.7.9 [async collection http_parser path stack_trace stream_channel] - shelf_packages_handler 1.0.4 [async path shelf shelf_static package_resolver] - shelf_static 0.2.8 [convert http_parser mime path shelf] - shelf_web_socket 0.2.3 [shelf web_socket_channel stream_channel] - sky_engine 0.0.99 - soundpool_macos 0.2.4 [flutter soundpool_platform_interface] - soundpool_platform_interface 1.0.1 [flutter meta plugin_platform_interface] - soundpool_web 1.0.3 [flutter flutter_web_plugins soundpool_platform_interface http] - source_gen 0.9.7+1 [analyzer async build dart_style glob meta path pedantic source_span] - source_map_stack_trace 2.0.0 [path stack_trace source_maps] - source_maps 0.10.9 [source_span] - source_span 1.7.0 [charcode collection meta path term_glyph] - sqflite_common 1.0.2+1 [synchronized path meta] - sqflite_common_ffi 1.1.0+1 [sqlite3 sqflite_common synchronized path meta] - sqlite3 0.1.5 [collection ffi meta] - stack_trace 1.9.5 [path] - stream_channel 2.0.0 [async] - stream_transform 1.2.0 - string_scanner 1.0.5 [charcode meta source_span] - sync_http 0.2.0 - synchronized 2.2.0+2 - term_glyph 1.1.0 - test_api 0.2.17 [async boolean_selector collection meta path source_span stack_trace stream_channel string_scanner term_glyph matcher] - test_core 0.3.10 [analyzer async args boolean_selector collection coverage glob io meta package_config path pedantic pool source_map_stack_trace source_maps source_span stack_trace stream_channel vm_service yaml matcher test_api] - timing 0.1.1+2 [json_annotation] - typed_data 1.2.0 [collection] - universal_io 1.0.1 [meta zone_local] - url_launcher_linux 0.0.1+1 [flutter] - url_launcher_macos 0.0.1+8 [flutter] - url_launcher_platform_interface 1.0.8 [flutter meta plugin_platform_interface] - url_launcher_web 0.1.4+1 [url_launcher_platform_interface flutter flutter_web_plugins meta] - url_launcher_windows 0.0.1+1 [flutter] - vector_math 2.0.8 - video_player_platform_interface 2.2.0 [flutter meta] - video_player_web 0.1.4 [flutter flutter_web_plugins meta video_player_platform_interface] - vm_service 2.3.1 [meta] - vm_service_client 0.2.6+2 [async collection json_rpc_2 pub_semver source_span stack_trace stream_channel web_socket_channel] - wakelock 0.1.4+2 [flutter] - watcher 0.9.7+15 [async path pedantic] - webdriver 2.1.2 [archive matcher path stack_trace sync_http] - webkit_inspection_protocol 0.7.3 [logging] - webview_flutter 0.3.24 [flutter] - win32 1.7.3 [ffi] - xdg_directories 0.1.0 [path process flutter] - xml 3.6.1 [collection convert meta petitparser] - yaml 2.2.1 [charcode collection string_scanner source_span] - zone_local 0.1.2 ```

Ehesp commented 4 years ago

Hey @Yaniv Shaked

Unfortunately we can't do anything about that. The events being sent are directly from the Firebase SDKs themselves. I'd suggest submitting a feature request here: https://firebase.google.com/support/troubleshooter/report

yanivshaked commented 4 years ago

The answer I got from firebase support:

As much as I want to help you out, integration with other frameworks like Flutter is already outside the scope of our capabilities. We have noted in our documentation that Flutter is only supported on a best-effort basis. These integrations are not covered by Firebase Support and may not have full feature parity with the official Firebase SDKs.

We can only assist you if you have questions regarding the use of official Firebase libraries, however if you are able to reproduce the issue with our quickstarts we may be able to take a look. You could also try asking in our community channels, such as Stack Overflow or Google Groups, where other developers may share their insight.

Hope you find a solution for your issue. If you have questions regarding Firebase, don't hesitate to contact us again.

@Ehesp It looks like there are two types of update events, and that the flutter wrapper is transferring only one type of them. Can someone please make sure that nothing is missing here?

Thanks!

Ehesp commented 4 years ago

It looks like there are two types of update events, and that the flutter wrapper is transferring only one type of them.

Can you show me what you mean?