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

[cloud_firestore]: Blob field in Firestore is always retrieved as false on Windows #17090

Open
1 task done
tortiolaware opened this issue Feb 14, 2025 · 1 comment
Open
1 task done
Labels
Needs Attention This issue needs maintainer attention. platform: windows Issues / PRs which are specifically for Windows. plugin: cloud_firestore type: bug Something isn't working

Comments

@tortiolaware
Copy link

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Database

Which platforms are affected?

Windows

Description

I'm trying to store and read a Blob object in cloud_firestore on Windows.

  • The Blob is stored correctly in Firestore.
  • However, when I try to retrieve it, the value is always returned as false. -> Error! Expected: return a Blob
  • The same code works as expected on Android.

Reproducing the issue

  1. run: flutter create prova
  2. configure Firebase and firestore with firebase cli
  3. create main.dart as follow:
import 'dart:convert';

import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:prova/firebase_options.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp(
    options: DefaultFirebaseOptions.currentPlatform,
  );
  final value = "Ciao come stai?";

  final docRef =
      FirebaseFirestore.instance.collection("prova").doc("my-document");

  await docRef.set({
    "myBlob": Blob(utf8.encode(value)),
  });

  final myBlobStored = (await docRef.get()).get("myBlob");
  print(myBlobStored); //prints false -> ERROR!
}

The object retrived is a boolean value equals to false

Firebase Core version

3.11.0

Flutter Version

3.27.4

Relevant Log Output

Flutter dependencies

Expand Flutter dependencies snippet
Dart SDK 3.6.2
Flutter SDK 3.27.4
prova 1.0.0+1

dependencies:
- cloud_firestore 5.6.3 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta]
- cupertino_icons 1.0.8
- firebase_core 3.11.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine]

dev dependencies:
- flutter_lints 5.0.0 [lints]
- flutter_test 0.0.0 [flutter test_api matcher path fake_async clock stack_trace vector_math leak_tracker_flutter_testing async boolean_selector characters collection leak_tracker leak_tracker_testing material_color_utilities meta source_span stream_channel string_scanner term_glyph vm_service]

transitive dependencies:
- _flutterfire_internals 1.3.51 [collection firebase_core firebase_core_platform_interface flutter meta]
- async 2.11.0 [collection meta]
- boolean_selector 2.1.1 [source_span string_scanner]
- characters 1.3.0
- clock 1.1.1
- cloud_firestore_platform_interface 6.6.3 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- cloud_firestore_web 4.4.3 [_flutterfire_internals cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins]
- collection 1.19.0
- fake_async 1.3.1 [clock collection]
- firebase_core_platform_interface 5.4.0 [collection flutter flutter_test meta plugin_platform_interface]
- firebase_core_web 2.20.0 [firebase_core_platform_interface flutter flutter_web_plugins meta web]
- flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math]
- leak_tracker 10.0.7 [clock collection meta path vm_service]
- leak_tracker_flutter_testing 3.0.8 [flutter leak_tracker leak_tracker_testing matcher meta]
- leak_tracker_testing 3.0.1 [leak_tracker matcher meta]
- lints 5.1.1
- matcher 0.12.16+1 [async meta stack_trace term_glyph test_api]
- material_color_utilities 0.11.1 [collection]
- meta 1.15.0
- path 1.9.0
- plugin_platform_interface 2.1.8 [meta]
- sky_engine 0.0.0
- source_span 1.10.0 [collection path term_glyph]
- stack_trace 1.12.0 [path]
- stream_channel 2.1.2 [async]
- string_scanner 1.3.0 [source_span]
- term_glyph 1.2.1
- test_api 0.7.3 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph]
- vector_math 2.1.4
- vm_service 14.3.0
- web 1.1.0


Additional context and comments

No response

@tortiolaware tortiolaware added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Feb 14, 2025
@SelaseKay SelaseKay added plugin: cloud_firestore platform: windows Issues / PRs which are specifically for Windows. labels Feb 17, 2025
@SelaseKay
Copy link
Contributor

cc @russellwheatley

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Attention This issue needs maintainer attention. platform: windows Issues / PRs which are specifically for Windows. plugin: cloud_firestore type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants