Listening to the same path multiple times will only return a result to the latest stream. However it must return a result to all streams i.e stream 1 & stream 2 print statements must get displayed.
This issue is present on web platform in DEBUG mode. The console display the following:
got stream 3 with value:null
got stream 3 with value:1
got stream 3 with value:2
When running in RELEASE mode there is no issue. The chrome console displays the following:
got stream 1 with value:2 js_primitives.dart:42
got stream 2 with value:2 js_primitives.dart:42
got stream 3 with value:2 js_primitives.dart:42
got stream 1 with value:3 js_primitives.dart:42
got stream 2 with value:3 js_primitives.dart:42
got stream 3 with value:3 js_primitives.dart:42
got stream 1 with value:4 js_primitives.dart:42
got stream 2 with value:4 js_primitives.dart:42
got stream 3 with value:4 js_primitives.dart:42
Lastly this worked fine in firebase_database 10.5.0 with firebase_core: 2.28.0 but is now broken in firebase_database: 11.0.4 with firebase_core 3.3.0.
Launching lib/main.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome...
This app is linked to the debug service: ws://127.0.0.1:64942/82TkgPvGJ0s=/ws
Debug service listening on ws://127.0.0.1:64942/82TkgPvGJ0s=/ws
Debug service listening on ws://127.0.0.1:64942/82TkgPvGJ0s=/ws
got stream 3 with value:null
got stream 3 with value:1
got stream 3 with value:2
Is there an existing issue for this?
Which plugins are affected?
Database
Which platforms are affected?
Web
Description
Listening to the same path multiple times will only return a result to the latest stream. However it must return a result to all streams i.e stream 1 & stream 2 print statements must get displayed.
Lastly this worked fine in firebase_database 10.5.0 with firebase_core: 2.28.0 but is now broken in firebase_database: 11.0.4 with firebase_core 3.3.0.
Reproducing the issue
Run the code sample & increment the counter:
Firebase Core version
3.3.0
Flutter Version
3.19.6
Relevant Log Output
Flutter dependencies
Expand
Flutter dependencies
snippet```yaml Dart SDK 3.3.4 Flutter SDK 3.19.6 web_debug_mode_issue 1.0.0+1 dependencies: - cupertino_icons 1.0.8 - firebase_core 3.3.0 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_database 11.0.4 [firebase_core firebase_core_platform_interface firebase_database_platform_interface firebase_database_web flutter] - flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine] dev dependencies: - flutter_lints 3.0.2 [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.40 [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 - collection 1.18.0 - fake_async 1.3.1 [clock collection] - firebase_core_platform_interface 5.2.0 [collection flutter flutter_test meta plugin_platform_interface] - firebase_core_web 2.17.4 [firebase_core_platform_interface flutter flutter_web_plugins meta web] - firebase_database_platform_interface 0.2.5+40 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_database_web 0.2.5+12 [collection firebase_core firebase_core_web firebase_database_platform_interface flutter flutter_web_plugins] - flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math] - 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 3.0.0 - matcher 0.12.16+1 [async meta stack_trace term_glyph test_api] - material_color_utilities 0.8.0 [collection] - meta 1.11.0 - path 1.9.0 - plugin_platform_interface 2.1.8 [meta] - 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] - vector_math 2.1.4 - vm_service 13.0.0 - web 0.5.1 ```
Additional context and comments
This issue has been reported previously here. I also added a comment to that issue. However the issue was locked.
So I have opened a new issue with sample code to reproduce it.