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.44k stars 3.91k forks source link

Firestore: Streaming Snapshot Errors in Flutter Web Application After FlutterFire CLI and Plugin Updates #12717

Closed AhmedElghandour closed 2 weeks ago

AhmedElghandour commented 2 weeks ago

Is there an existing issue for this?

Which plugins are affected?

Database

Which platforms are affected?

Web

Description

After updating the FlutterFire CLI and all Firestore plugins in my Flutter web application, I have encountered intermittent issues with streaming snapshots. The application occasionally stops streaming snapshots, and the following errors are logged:

https://firestore.googleapis.com/google.firestore.v1.Firestore/Listen/channel?gsessionid 404 (Not Found)

[2024-04-28T15:21:01.491Z] @firebase/firestore: Firestore (10.11.0): WebChannelConnection RPC 'Listen' stream 0x81443a92 transport errored:

This issue seems to occur sporadically and has persisted for a while now. I also tested another previously published project that was functioning correctly before. However, after updating its FlutterFire and Firebase plugins, it too began experiencing the same issues, indicating that the problem could be related to the recent updates.

I have attempted to contact support, and based on the error information and their feedback, it appears there might be a problem related to data access in offline mode, connection errors, or an incorrect URL leading to a 404 error. However, no specific errors were found on my Firestore database according to the support team, suggesting the data may not be reaching Firestore when attempts are made to retrieve data.

Reproducing the issue

1- Update FlutterFire CLI and Firestore plugins in the Flutter web application. 2- Attempt to stream snapshots from Firestore. 3- Observe the intermittent cessation of snapshot streaming and the above errors.

Firebase Core version

2.30.1

Flutter Version

3.19.6

Relevant Log Output

No response

Flutter dependencies

Expand Flutter dependencies snippet
```yaml Dart SDK 3.3.4 Flutter SDK 3.19.6 events_graphs 1.0.0+1 dependencies: - _flutterfire_internals 1.3.32 [collection firebase_core firebase_core_platform_interface flutter meta] - bloc 8.1.1 [meta] - cloud_firestore 4.17.2 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta] - cloud_functions 4.7.3 [cloud_functions_platform_interface cloud_functions_web firebase_core firebase_core_platform_interface flutter] - cupertino_icons 1.0.5 - equatable 2.0.5 [collection meta] - firebase_auth 4.19.4 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta] - firebase_core 2.30.1 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_database 10.5.4 [firebase_core firebase_core_platform_interface firebase_database_platform_interface firebase_database_web flutter] - firebase_storage 11.7.4 [firebase_core firebase_core_platform_interface firebase_storage_platform_interface firebase_storage_web flutter] - flow_builder 0.1.0 [flutter] - flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine] - flutter_bloc 8.1.2 [flutter bloc provider] - flutter_easyloading 3.0.5 [flutter flutter_spinkit] - syncfusion_flutter_charts 20.4.53 [flutter intl vector_math syncfusion_flutter_core] - syncfusion_flutter_core 20.4.53 [vector_math flutter] - think_form 0.0.1 [flutter flutter_form_builder form_builder_validators adaptive_breakpoints dual_screen flutter_staggered_grid_view dropdown_search intl url_launcher] dev dependencies: - flutter_lints 2.0.1 [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: - adaptive_breakpoints 0.1.7 [flutter] - 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.2.2 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - cloud_firestore_web 3.12.2 [_flutterfire_internals cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins] - cloud_functions_platform_interface 5.5.25 [firebase_core flutter meta plugin_platform_interface] - cloud_functions_web 4.9.3 [cloud_functions_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins] - collection 1.18.0 - dropdown_search 5.0.6 [flutter] - dual_screen 1.0.4 [flutter] - fake_async 1.3.1 [clock collection] - firebase_auth_platform_interface 7.2.5 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_auth_web 5.11.4 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser meta web] - firebase_core_platform_interface 5.0.0 [collection flutter flutter_test meta plugin_platform_interface] - firebase_core_web 2.16.0 [firebase_core_platform_interface flutter flutter_web_plugins meta web] - firebase_database_platform_interface 0.2.5+32 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_database_web 0.2.5+4 [firebase_core firebase_core_web firebase_database_platform_interface flutter flutter_web_plugins] - firebase_storage_platform_interface 5.1.19 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_storage_web 3.9.4 [_flutterfire_internals async firebase_core firebase_core_web firebase_storage_platform_interface flutter flutter_web_plugins http meta web] - flutter_form_builder 9.2.1 [flutter intl] - flutter_localizations 0.0.0 [flutter intl characters clock collection material_color_utilities meta path vector_math] - flutter_spinkit 5.2.1 [flutter] - flutter_staggered_grid_view 0.7.0 [flutter] - flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math] - form_builder_validators 9.1.0 [flutter flutter_localizations intl] - http 0.13.6 [async http_parser meta] - http_parser 4.0.2 [collection source_span string_scanner typed_data] - intl 0.18.1 [clock meta path] - leak_tracker 10.0.0 [clock collection meta path vm_service] - leak_tracker_flutter_testing 2.0.1 [flutter leak_tracker leak_tracker_testing matcher meta] - leak_tracker_testing 2.0.1 [leak_tracker matcher meta] - lints 2.0.1 - matcher 0.12.16+1 [async meta stack_trace term_glyph test_api] - material_color_utilities 0.8.0 [collection] - meta 1.11.0 - nested 1.0.0 [flutter] - path 1.9.0 - plugin_platform_interface 2.1.4 [meta] - provider 6.0.5 [collection flutter nested] - sky_engine 0.0.99 - source_span 1.10.0 [collection path term_glyph] - stack_trace 1.11.1 [path] - stream_channel 2.1.2 [async] - string_scanner 1.2.0 [source_span] - term_glyph 1.2.1 - test_api 0.6.1 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph] - typed_data 1.3.2 [collection] - url_launcher 6.1.7 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows] - url_launcher_android 6.2.2 [flutter url_launcher_platform_interface] - url_launcher_ios 6.2.5 [flutter url_launcher_platform_interface] - url_launcher_linux 3.1.1 [flutter url_launcher_platform_interface] - url_launcher_macos 3.1.0 [flutter url_launcher_platform_interface] - url_launcher_platform_interface 2.3.0 [flutter plugin_platform_interface] - url_launcher_web 2.3.1 [flutter flutter_web_plugins url_launcher_platform_interface web] - url_launcher_windows 3.1.1 [flutter url_launcher_platform_interface] - vector_math 2.1.4 - vm_service 13.0.0 - web 0.5.1 ```

Additional context and comments

No response

TarekkMA commented 2 weeks ago

Hello @AhmedElghandour,

Could you please share a minimal reproducible example? This will help us better understand and address the issue. Additionally, if possible, try using the example app found here to see if you encounter the same issues. Thank you!

AhmedElghandour commented 2 weeks ago

Hello @AhmedElghandour,

Could you please share a minimal reproducible example? This will help us better understand and address the issue. Additionally, if possible, try using the example app found here to see if you encounter the same issues. Thank you!

Hello @TarekkMA

I have checked with the example after I added my firebase config and still the problem. can you check this reference https://github.com/firebase/firebase-js-sdk/issues/7860

TarekkMA commented 2 weeks ago

According to https://github.com/firebase/firebase-js-sdk/issues/7860, It appears this issue was fixed in version 10.11.1, which we've already upgraded to in this PR. Could you try using a Git reference as described here to point to the master branch and test if the issue still persists? Let us know your findings!

Thanks!

AhmedElghandour commented 2 weeks ago

Thank you, worked well with the master branch.