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.63k stars 3.95k forks source link

[<CLOUD FIRESTORE>] <Flutter Web Profile / Release Blob minified issue> #2747

Closed ssilverstein closed 4 years ago

ssilverstein commented 4 years ago

Describe the bug A clear and concise description of what the bug is.

When making use of the Blob type to create a document field in Cloud Firestore, Flutter Web "profile" and "release" are unable to properly retrieve and read the document Blob field.

To Reproduce Steps to reproduce the behavior:

  1. Go to Firebase Console and create new project
  2. Enable Database Cloud Firestore
  3. Create new Fluter project
  4. Add flutter web application to Firebase Project, retrieve config
  5. Add config script to web/index.html
  6. Add script CDN for firestore
  7. import Cloud Firestore in pub.spec
  8. Create an empty collection in Firebase Console.
  9. Flutter app add document to cloud with a Blob as field value in Map<String, dynamic>
  10. Flutter App get or snapshot document from firebase
  11. access Blob field bytes
  12. See error or incorrect behavior

Expected behavior Expect to be able to retrieve and access Blob type from Firestore and make use of Blob bytes without error as in Andriod / iOS Debug / Profile / Release and Web debug.

Additional context

Flutter Web profile reads Blob object type as Instance of 'GeoPoint' and release as instance of 'minified' both unable to access the .bytes field of the Blob type

Web applications in Profile or release build can continue to write Blob fields to the firestore database. When application is run in debug mode application is able to read blobs written in profile or release mode properly.

When looking a web console for js_primitives -

Could not load content for org-dartlang-sdk:///lib/_internal/js_runtime/lib/js_primitives.dart (HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME)

Flutter Web Debug Mode - Expected Behavior in all modes flutter web debug

Flutter Web Profile Mode - Blob returned as 'GeoPoint' bytes toString is null flutter web profile

Flutter Web Release Mode - Blob return as minified bytes toString is null flutter web release

Firestore Document field is type blob in Firebase console firestore documnet blob field

Flutter doctor Run flutter doctor and paste the output below:

[βœ“] Flutter (Channel beta, 1.19.0-4.1.pre, on Mac OS X 10.14.6 18G95, locale en-US)

[βœ“] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[!] Xcode - develop for iOS and macOS (Xcode 11.0)
    ! CocoaPods 1.6.1 out of date (1.8.0 is recommended).
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that
        responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To upgrade:
        sudo gem install cocoapods
[βœ“] Chrome - develop for the web
[βœ“] Android Studio (version 3.5)
[βœ“] VS Code (version 1.45.0)
[βœ“] Connected device (4 available)

! Doctor found issues in 1 category.
iapicca commented 4 years ago

Hi @ssilverstein this issue appears to be the same as the one you linked Please follow up on that issue, I'm closing the current one as duplicate. If you disagree, please write in the comments and I will reopen it. Thank you