When there is an error with a Firestore collection listener, the error is never reported back to Flutter. This leads to an odd state where the data is stream is always waiting. It would be better to report the error so that app can handle it.
Steps to Reproduce
- Clone my fork of the plugins repository: https://github.com/KevinTheGray/plugins
- git checkout branch
kg-firebase-stream-error
- run the
cloud-firestore example project
- Notice this print statement is never hit, even though there is clearly an error reported from the plugin due to a permission failure.
Logs
flutter: builder - snapshot: AsyncSnapshot<QuerySnapshot>(ConnectionState.waiting, null, null)
6.2.0 - [Firebase/Firestore][I-FST000001] Listen for query at invalid failed: Missing or insufficient permissions.
Analyze
Analyzing example...
No issues found! (ran in 16.5s)
Flutter Doctor -v
[✓] Flutter (Channel beta, v1.7.8+hotfix.4, on Mac OS X 10.14.5 18F132, locale en-US)
• Flutter version 1.7.8+hotfix.4 at /Users/KG/Developer/Flutter/flutter
• Framework revision 20e59316b8 (3 weeks ago), 2019-07-18 20:04:33 -0700
• Engine revision fee001c93f
• Dart version 2.4.0
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/KG/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = /Users/KG/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_152-release-1248-b01)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.3, Build version 10G8
• CocoaPods version 1.7.1
[!] iOS tools - develop for iOS devices
✗ Verify that all connected devices have been paired with this computer in Xcode.
If all devices have been paired, libimobiledevice and ideviceinstaller may require updating.
To update with Brew, run:
brew update
brew uninstall --ignore-dependencies libimobiledevice
brew uninstall --ignore-dependencies usbmuxd
brew install --HEAD usbmuxd
brew unlink usbmuxd
brew link usbmuxd
brew install --HEAD libimobiledevice
brew install ideviceinstaller
• ios-deploy 1.9.4
[✓] Android Studio (version 3.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 33.3.1
• Dart plugin version 182.5215
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
[✓] IntelliJ IDEA Community Edition (version 2018.2.5)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin version 29.1.3
• Dart plugin version 182.4892.25
When there is an error with a Firestore collection listener, the error is never reported back to Flutter. This leads to an odd state where the data is stream is always waiting. It would be better to report the error so that app can handle it.
Steps to Reproduce
kg-firebase-stream-errorcloud-firestoreexample projectLogs
Analyze
Flutter Doctor -v