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.5k stars 3.92k forks source link

Bug: Flutter Firestore : Flutter Firestore Web using streams is EXTREMELY slow #4254

Closed real1900 closed 3 years ago

real1900 commented 3 years ago

I have an iOS and android app where I am using firestore and it works great and the performance is impressive. However when I launch the same app on the web the performance of the queries is very slow. I'm not sure if it's due to the fact that I have persistence enabled or some other issue but there is a good 20 to 30 second delay before it starts to show any data and I'm talking about just one simple collection with no complex lookups.it just takes forever like over 30 seconds and even though I have persistence enabled, I don't think it works because it always takes the same amount of time to show the same data. Any ideas or direction?

TahaTesser commented 3 years ago

Hi @real1900 Can you please provide your flutter doctor -v, your pubspec.yaml, your flutter run --verbose, and a complete reproducible minimal code sample Thank you

real1900 commented 3 years ago

Here is what my flutter doctor -v looks like :

flutter doctor -v
[✓] Flutter (Channel beta, 1.24.0-10.2.pre, on macOS 11.0.1 20B29 darwin-x64, locale en)
    • Flutter version 1.24.0-10.2.pre at /Users/sulemanimdad/developer/flutter
    • Framework revision 022b333a08 (2 weeks ago), 2020-11-18 11:35:09 -0800
    • Engine revision 07c1eed46b
    • Dart version 2.12.0 (build 2.12.0-29.10.beta)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/sulemanimdad/Library/Android/Sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_SDK_ROOT = /Users/sulemanimdad/Library/Android/Sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.1.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.1.1, Build version 12A7605b
    • CocoaPods version 1.10.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.51.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.16.0

[✓] Connected device (3 available)
    • iPhone 12 Pro Max (mobile) • 4F28811C-6915-47C2-BEA3-E3E04624A197 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-1
      (simulator)
    • Web Server (web)           • web-server                           • web-javascript • Flutter Tools
    • Chrome (web)               • chrome                               • web-javascript • Google Chrome 86.0.4240.198
    ! Error: Suleman’s iPhone  is busy: Waiting for Device. Xcode will continue when Suleman’s iPhone  is finished. (code -10)

• No issues found!
real1900 commented 3 years ago

Here is what my pubspec.yaml looks like :

name: submission_flutter
description: Submission App built using Flutter and Dart

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1

environment:
  sdk: '>=2.10.0 <3.0.0'

dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^1.0.1+1
  flutter_compass: ^0.4.2
  provider: ^4.0.0
  location: ^3.0.0
  intl: ^0.16.1
  shared_preferences: ^0.5.6+3
  percent_indicator: ^2.1.1 # - widget for showing Salat Progress
  hijri: ^0.2.5
  geocoder: ^0.2.1
  line_awesome_icons: ^1.0.4+2
  google_maps_flutter: ^0.5.28
  google_maps_flutter_web: ^0.1.0 #for displaying on the web with the regular build - missing markers
  google_maps: ^3.4.5 # stricty being used just for building with web only
  vibration: ^1.2.4
  firebase_core: ^0.5.2
  firebase_auth: ^0.18.0+1
  firebase_analytics: ^6.0.1
  firebase_auth_platform_interface: any
  firebase_auth_web: any
  cloud_firestore: ^0.14.3
  firebase_crashlytics: ^0.2.1
  firebase_storage: ^5.0.1
  flutter_signin_button: ^1.1.0
  google_sign_in: ^4.5.3
  apple_sign_in: ^0.1.0
  firebase_dynamic_links: ^0.3.0
  flutter_facebook_login: ^3.0.0
  cached_network_image: ^2.3.1 #to use cached images
  flutter_playout: # for Video Player
    git:
      url: https://github.com/real1900/flutter_playout.git
  dart_notification_center: ^1.0.0+1 # for event Notifications within the code for media player etc
  marquee_flutter: ^0.1.4 # for sliding text in Media Player
  audioplayers: ^0.16.2
  path_provider: ^1.6.1 #audio
  path: ^1.6.4 #audio
  google_fonts: ^0.4.0 #for fonts
  transparent_image: ^1.0.0 # for placeholders
  wakelock: ^0.2.1+1 # prevents app from sleeping
  flutter_local_notifications: ^1.4.4+2 # for salat Notifications
  flutter_tts: ^1.3.0
  flutter_staggered_animations: ^0.1.2
  animate_do: ^1.7.2
  flutter_share: ^1.0.2+1
  html: ^0.14.0+3 #for appendix cleaning
  device_info: ^0.4.2+4
  rxdart: ^0.24.1 #for combining streams
  webview_flutter: ^0.3.22+1 #for Appendices
  scrollable_positioned_list: ^0.1.6 # for jumping inside listview == REMOVE LATER
  scroll_to_index: ^1.0.6 # for jumping inside listview  == BEST CHOICE
  recase: ^3.0.0 #convert cases for Google Fonts /camel case etc
  sembast: ^2.4.7+6 #search Quran
  dynamic_text_highlighting: ^2.2.0 #search Quran highlight text
  just_debounce_it: ^3.0.0+2 #debouncing for better search experience
  background_fetch: ^0.6.0 #used for background task of updating text
  epub: ^2.1.0
  flutter_widget_from_html_core: ^0.4.3
  websafe_platform: ^1.0.2 #for switching to web
  native_pdf_view: ^3.8.0
  image_picker: ^0.6.7+9
  indexed_list_view: ^1.0.9 # for jumping inside listview
  permission_handler: ^5.0.1
  navigator_transitions_route: ^0.1.3
  jitsi_meet: ^1.2.0
  firebase_admin: ^0.1.3
  flutter_chips_input: ^1.9.4
  timeago: ^2.0.28
  firebase_messaging: ^7.0.0
  callkeep: ^0.2.0
  uuid: ^2.2.2
  sembast_web: ^1.0.0
  audio_service: ^0.15.3
  just_audio: ^0.5.6
  audio_session: ^0.0.9
  video_player: ^1.0.1 #video for web
  extended_image: ^1.3.1-dev # some dependancy

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_launcher_icons: "^0.7.3"

flutter_icons:
  android: true
  ios: true
  image_path: "images/Icon.png"

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:
  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  assets:
    - images/
    - assets/

  fonts:
    - family: NafeesNastaleeq
      fonts:
        - asset: fonts/nafees_nastaleeq.ttf
    - family: IranNastaleeq
      fonts:
        - asset: fonts/iran_nastaleeq.ttf
  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/assets-and-images/#resolution-aware.
  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/assets-and-images/#from-packages
  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  # fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages
TahaTesser commented 3 years ago

Hi @real1900 Can you please provide a minimal complete reproducible code sample without using non-flutterfire packages Thank you

google-oss-bot commented 3 years ago

Hey @real1900. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

real1900 commented 3 years ago

I addressed some other bugs in my application and the process I am unable to reproduce this issue .