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

FirebaseFirestore: snapshot calling multiple times with isLessThan or isGreaterThan where query. #12673

Open
1 task done
vikramsinghrajpoot opened this issue Apr 19, 2024 · 2 comments
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. platform: android Issues / PRs which are specifically for Android. platform: ios Issues / PRs which are specifically for iOS. plugin: cloud_firestore Stale Issue with no recent activity type: bug Something isn't working

Comments

@vikramsinghrajpoot
Copy link

vikramsinghrajpoot commented Apr 19, 2024

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Database, Storage

Which platforms are affected?

Android, iOS

Description

Firebase snapshots calling multiple times while using isLessThan and isGreaterThan in where query.
while comment the isLessThan and isGreaterThan it worked as expacted.

Reproducing the issue

Create a table in firestore db name products

where
status is a string
type is string
server is string
geo_point is geopoint

and make a query like:

FirebaseFirestore firestore = FirebaseFirestore.instance;
CollectionReference reference = firestore.collection("products");

reference
        .where("status", isEqualTo: status)
        .where("type", isEqualTo: type)
        .where("server", isEqualTo: server)
        .where("geo_point", isGreaterThan: lesserGeopoint)
        .where("geo_point", isLessThan: greaterGeopoint)
        .snapshots();

Firebase Core version

2.30.0

Flutter Version

3.19.2

Relevant Log Output

It snapshot should return only one time.

Flutter dependencies

Expand Flutter dependencies snippet
Dart SDK 3.3.0
Flutter SDK 3.19.2
ninty_acres 1.0.0+1

dependencies:
- cloud_firestore 4.17.0 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta]
- cupertino_icons 1.0.5
- encrypted_shared_preferences 3.0.1 [encrypt shared_preferences]
- equatable 2.0.5 [collection meta]
- firebase_auth 4.19.2 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta]
- firebase_core 2.30.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_remote_config 4.4.2 [firebase_core firebase_core_platform_interface firebase_remote_config_platform_interface firebase_remote_config_web flutter]
- firebase_storage 11.7.2 [firebase_core firebase_core_platform_interface firebase_storage_platform_interface firebase_storage_web flutter]
- flashy_tab_bar2 0.0.6 [flutter]
- flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine]
- flutter_bloc 8.1.3 [bloc flutter provider]
- flutter_material 0.0.1 [flutter]
- flutter_svg 2.0.5 [flutter vector_graphics vector_graphics_codec vector_graphics_compiler]
- fluttertoast 8.2.4 [flutter flutter_web_plugins]
- geocoding 2.2.0 [flutter geocoding_platform_interface geocoding_android geocoding_ios]
- geolocator 10.1.1 [flutter geolocator_platform_interface geolocator_android geolocator_apple geolocator_web geolocator_windows]
- go_router 10.1.0 [collection flutter flutter_web_plugins logging meta]
- image_picker 0.8.9 [flutter image_picker_android image_picker_for_web image_picker_ios image_picker_linux image_picker_macos image_picker_platform_interface image_picker_windows]
- intl 0.18.1 [clock meta path]
- lottie 2.3.2 [archive flutter path vector_math]
- package_info_plus 4.2.0 [ffi flutter flutter_web_plugins http meta path package_info_plus_platform_interface win32]
- url_launcher 6.2.6 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows]

dev dependencies:
- flutter_lints 1.0.4 [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.30 [collection firebase_core firebase_core_platform_interface flutter meta]
- archive 3.3.7 [crypto path pointycastle]
- args 2.4.2
- asn1lib 1.4.1
- async 2.11.0 [collection meta]
- bloc 8.1.2 [meta]
- boolean_selector 2.1.1 [source_span string_scanner]
- characters 1.3.0
- clock 1.1.1
- cloud_firestore_platform_interface 6.2.0 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- cloud_firestore_web 3.12.0 [_flutterfire_internals cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins]
- collection 1.18.0
- convert 3.1.1 [typed_data]
- cross_file 0.3.3+4 [js meta]
- crypto 3.0.3 [typed_data]
- encrypt 5.0.1 [args asn1lib clock collection crypto pointycastle]
- fake_async 1.3.1 [clock collection]
- ffi 2.0.2
- file 6.1.4 [meta path]
- file_selector_linux 0.9.2 [cross_file file_selector_platform_interface flutter]
- file_selector_macos 0.9.3+1 [cross_file file_selector_platform_interface flutter]
- file_selector_platform_interface 2.6.0 [cross_file flutter http plugin_platform_interface]
- file_selector_windows 0.9.3 [cross_file file_selector_platform_interface flutter]
- firebase_auth_platform_interface 7.2.3 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- firebase_auth_web 5.11.2 [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.15.0 [firebase_core_platform_interface flutter flutter_web_plugins meta web]
- firebase_remote_config_platform_interface 1.4.30 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
- firebase_remote_config_web 1.6.2 [firebase_core firebase_core_web firebase_remote_config_platform_interface flutter flutter_web_plugins]
- firebase_storage_platform_interface 5.1.17 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- firebase_storage_web 3.9.2 [_flutterfire_internals async firebase_core firebase_core_web firebase_storage_platform_interface flutter flutter_web_plugins http meta web]
- flutter_plugin_android_lifecycle 2.0.15 [flutter]
- flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math]
- geocoding_android 3.2.0 [flutter geocoding_platform_interface]
- geocoding_ios 2.3.0 [flutter geocoding_platform_interface]
- geocoding_platform_interface 3.2.0 [flutter meta plugin_platform_interface]
- geolocator_android 4.4.1 [flutter geolocator_platform_interface uuid]
- geolocator_apple 2.3.6 [flutter geolocator_platform_interface]
- geolocator_platform_interface 4.1.0 [flutter plugin_platform_interface vector_math meta]
- geolocator_web 2.2.1 [flutter flutter_web_plugins geolocator_platform_interface]
- geolocator_windows 0.2.2 [flutter geolocator_platform_interface]
- http 0.13.6 [async http_parser meta]
- http_parser 4.0.2 [collection source_span string_scanner typed_data]
- image_picker_android 0.8.7+4 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface]
- image_picker_for_web 2.2.0 [flutter flutter_web_plugins image_picker_platform_interface mime]
- image_picker_ios 0.8.8 [flutter image_picker_platform_interface]
- image_picker_linux 0.2.1 [file_selector_linux file_selector_platform_interface flutter image_picker_platform_interface]
- image_picker_macos 0.2.1 [file_selector_macos file_selector_platform_interface flutter image_picker_platform_interface]
- image_picker_platform_interface 2.9.0 [cross_file flutter http plugin_platform_interface]
- image_picker_windows 0.2.1 [file_selector_platform_interface file_selector_windows flutter image_picker_platform_interface]
- js 0.6.7 [meta]
- 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 1.0.1
- logging 1.2.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
- mime 1.0.4
- nested 1.0.0 [flutter]
- package_info_plus_platform_interface 2.0.1 [flutter meta plugin_platform_interface]
- path 1.9.0
- path_parsing 1.0.1 [vector_math meta]
- path_provider_linux 2.2.0 [ffi flutter path path_provider_platform_interface xdg_directories]
- path_provider_platform_interface 2.1.0 [flutter platform plugin_platform_interface]
- path_provider_windows 2.2.0 [ffi flutter path path_provider_platform_interface win32]
- petitparser 5.1.0 [meta]
- platform 3.1.0
- plugin_platform_interface 2.1.5 [meta]
- pointycastle 3.7.3 [collection convert js]
- provider 6.0.5 [collection flutter nested]
- shared_preferences 2.2.0 [flutter shared_preferences_android shared_preferences_foundation shared_preferences_linux shared_preferences_platform_interface shared_preferences_web shared_preferences_windows]
- shared_preferences_android 2.2.0 [flutter shared_preferences_platform_interface]
- shared_preferences_foundation 2.3.3 [flutter shared_preferences_platform_interface]
- shared_preferences_linux 2.3.0 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface]
- shared_preferences_platform_interface 2.3.0 [flutter plugin_platform_interface]
- shared_preferences_web 2.2.0 [flutter flutter_web_plugins shared_preferences_platform_interface]
- shared_preferences_windows 2.3.0 [file flutter path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface]
- sky_engine 0.0.99
- source_span 1.10.0 [collection path term_glyph]
- sprintf 7.0.0
- 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_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]
- uuid 4.2.2 [crypto sprintf meta]
- vector_graphics 1.1.5 [flutter vector_graphics_codec]
- vector_graphics_codec 1.1.5
- vector_graphics_compiler 1.1.5 [args meta path_parsing xml vector_graphics_codec]
- vector_math 2.1.4
- vm_service 13.0.0
- web 0.5.1
- win32 4.1.4 [ffi]
- xdg_directories 1.0.2 [meta path]
- xml 6.2.2 [collection meta petitparser]

Additional context and comments

NA

@vikramsinghrajpoot vikramsinghrajpoot added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Apr 19, 2024
@TarekkMA TarekkMA added plugin: cloud_firestore platform: android Issues / PRs which are specifically for Android. platform: ios Issues / PRs which are specifically for iOS. labels Apr 19, 2024
@russellwheatley
Copy link
Member

I've just tested this by adding a bunch of documents and I got only one snapshot event with all the documents. We're going to need a reproduction.

@russellwheatley russellwheatley added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels Apr 23, 2024
@google-oss-bot
Copy link

Hey @vikramsinghrajpoot. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@google-oss-bot google-oss-bot added the Stale Issue with no recent activity label May 2, 2024
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: android Issues / PRs which are specifically for Android. platform: ios Issues / PRs which are specifically for iOS. plugin: cloud_firestore Stale Issue with no recent activity type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants