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

[firebase_firestore]: Stream does not load value, but future does on web #13019

Open
1 task done
Albert-Jan opened this issue Jul 1, 2024 · 2 comments
Open
1 task done
Assignees
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. platform: web Issues / PRs which are specifically for web. plugin: cloud_firestore type: bug Something isn't working

Comments

@Albert-Jan
Copy link

Albert-Jan commented Jul 1, 2024

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Cloud Firesotre

Which platforms are affected?

Web

Description

After updating Flutter Firestore from version 4.X to 5.X, the web version, the stream no longer emits a value. Downgrading makes the same code work as expected. The future of the same document works without a problem.

Reproducing the issue

Listen to a stream:

Stream<Project> listenProject(String projectId) => _service.doc(FirestorePath.project(projectId)).snapshots().map((DocumentSnapshot<Map<String, dynamic>> data) => Project.fromMap(data.data()!));

Future loads just fine:
Future<Project> getProject(String projectId) async => _service.doc(FirestorePath.project(projectId)).get().then((DocumentSnapshot<Map<String, dynamic>> data) => Project.fromMap(data.data()!));

Firebase Core version

3.1.1

Flutter Version

3.22.2

Relevant Log Output

No error is thrown, even when wrapped with try/catch

Flutter dependencies

No response

Additional context and comments

No response

@Albert-Jan Albert-Jan added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Jul 1, 2024
@TarekkMA TarekkMA added plugin: database platform: web Issues / PRs which are specifically for web. plugin: cloud_firestore and removed plugin: database labels Jul 2, 2024
@TarekkMA TarekkMA self-assigned this Jul 2, 2024
@TarekkMA
Copy link
Contributor

TarekkMA commented Jul 2, 2024

@Albert-Jan Thank you for reporting this issue. I've replicated the code for the example Firestore app in this branch: issue/13019, and I didn't find any issues. Can you try this branch and see if you still have problems?

@TarekkMA TarekkMA added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels Jul 2, 2024
@Albert-Jan
Copy link
Author

Thanks for your response; I updated my pubspec to rely on the cloud_firestore of the custom branch. I also performed a flutter clean to make sure it was properly compiled.

cloud_firestore: git: url: https://github.com/firebase/flutterfire.git ref: issue/13019 # branch name path: packages/cloud_firestore/cloud_firestore

Unfortunately, it did not work as expected, and the same bug happened. I double checked and downgrading to cloud_firestore: 4.17.4 does work as expected without any code changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. platform: web Issues / PRs which are specifically for web. plugin: cloud_firestore type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants