Skip to content

[firebase_database]: 12.1.x causes crash on iOS when using .startAt #18132

@robindijkhof

Description

@robindijkhof

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Database

Which platforms are affected?

iOS

Description

[firebase_database]: 12.1.x causes crash on iOS when using .startAt

It causes a fatal crash. Losing connection the the device when debugging.

Reproducing the issue

such a simple statement causes the crash:

    _getObjectsRef().asStream().switchMap((ref) => ref
        .startAt(1772319600000, key: 'start')
        .onValue)
    .listen(...)

Firebase Core version

4.5.0

Flutter Version

3.41.5

Relevant Log Output

Last Exception Backtrace:
0   CoreFoundation                	       0x1804f733c __exceptionPreprocess + 160
1   libobjc.A.dylib               	       0x18009c094 objc_exception_throw + 72
2   CoreFoundation                	       0x1804f7258 -[NSException initWithCoder:] + 0
3   FirebaseDatabase              	       0x10234ae10 -[FIRDatabaseQuery validateLimitRange:] + 68 (FIRDatabaseQuery.m:405)
4   FirebaseDatabase              	       0x10234aee8 -[FIRDatabaseQuery queryLimitedToFirst:] + 144 (FIRDatabaseQuery.m:418)
5   FirebaseDatabase              	       0x102350030 -[FIRDatabaseReference queryLimitedToFirst:] + 64 (FIRDatabaseReference.m:453)
6   Runner.debug.dylib            	       0x101cc257c FLTFirebaseDatabasePlugin.queryObserve(app:request:completion:) + 4040 (FLTFirebaseDatabasePlugin.swift:424)
7   Runner.debug.dylib            	       0x101cc9c4c protocol witness for FirebaseDatabaseHostApi.queryObserve(app:request:completion:) in conformance FLTFirebaseDatabasePlugin + 44
8   Runner.debug.dylib            	       0x101cb278c closure #20 in static FirebaseDatabaseHostApiSetup.setUp(binaryMessenger:api:messageChannelSuffix:) + 884 (FirebaseDatabaseMessages.g.swift:984)
9   Runner.debug.dylib            	       0x101c6041c thunk for @escaping @callee_guaranteed (@in_guaranteed Any?, @guaranteed @escaping @callee_guaranteed (@in_guaranteed Any?) -> ()) -> () + 228
10  Flutter                       	       0x1058889d4 __48-[FlutterBasicMessageChannel setMessageHandler:]_block_invoke + 160
11  Flutter                       	       0x1053aa7b8 invocation function for block in flutter::PlatformMessageHandlerIos::HandlePlatformMessage(std::__fl::unique_ptr<flutter::PlatformMessage, std::__fl::default_delete<flutter::PlatformMessage>>) + 108
12  libdispatch.dylib             	       0x1801c07a8 _dispatch_call_block_and_release + 24
13  libdispatch.dylib             	       0x1801db4b0 _dispatch_client_callout + 12
14  libdispatch.dylib             	       0x1801f74a0 <deduplicated_symbol> + 24
15  libdispatch.dylib             	       0x1801d031c _dispatch_main_queue_drain + 1184
16  libdispatch.dylib             	       0x1801cfe6c _dispatch_main_queue_callback_4CF + 40
17  CoreFoundation                	       0x180455fa8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
18  CoreFoundation                	       0x180455180 __CFRunLoopRun + 1884
19  CoreFoundation                	       0x18044fdbc _CFRunLoopRunSpecificWithOptions + 496
20  GraphicsServices              	       0x192b809bc GSEventRunModal + 116
21  UIKitCore                     	       0x18640a204 -[UIApplication _run] + 772
22  UIKitCore                     	       0x18640e42c UIApplicationMain + 124
23  UIKitCore                     	       0x18563f6b8 0x18525e000 + 4069048
24  Runner.debug.dylib            	       0x101941918 static UIApplicationDelegate.main() + 128
25  Runner.debug.dylib            	       0x101941888 static AppDelegate.$main() + 44
26  Runner.debug.dylib            	       0x101941994 __debug_main_executable_dylib_entry_point + 28
27  ???                           	       0x100d093d0 ???
28  dyld                          	       0x100fd8d54 start + 7184

Flutter dependencies

Expand Flutter dependencies snippet
Dart SDK 3.11.3
Flutter SDK 3.41.5
urenapp 5.24.3+234

dependencies:
- app_links 7.0.0 [flutter app_links_linux app_links_platform_interface app_links_web]
- cached_network_image 3.4.1 [cached_network_image_platform_interface cached_network_image_web flutter flutter_cache_manager octo_image]
- collection 1.19.1
- cupertino_icons 1.0.8
- dropdown_search 6.0.2 [flutter]
- file 7.0.1 [meta path]
- firebase_analytics 12.1.3 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter]
- firebase_auth 6.2.0 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta]
- firebase_core 4.5.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_crashlytics 5.0.8 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace]
- firebase_database 12.1.0 [firebase_core firebase_core_platform_interface firebase_database_platform_interface firebase_database_web flutter]
- firebase_storage 13.1.0 [firebase_core firebase_core_platform_interface firebase_storage_platform_interface firebase_storage_web flutter]
- flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine]
- flutter_local_notifications 19.5.0 [clock flutter flutter_local_notifications_linux flutter_local_notifications_windows flutter_local_notifications_platform_interface timezone]
- flutter_localizations 0.0.0 [flutter intl path]
- flutter_mailer 3.0.1 [flutter]
- flutter_picker_plus 1.5.6 [flutter]
- flutter_timezone 5.0.2 [equatable flutter flutter_web_plugins meta]
- fluttertoast 9.0.0 [flutter flutter_web_plugins web]
- google_mobile_ads 7.0.0 [meta flutter webview_flutter_android webview_flutter_wkwebview webview_flutter]
- google_sign_in 7.2.0 [flutter google_sign_in_android google_sign_in_ios google_sign_in_platform_interface google_sign_in_web]
- http 1.6.0 [async http_parser meta web]
- i18n_extension 15.1.0 [intl i18n_extension_core http shared_preferences gettext_parser flutter]
- image_picker 1.2.1 [flutter image_picker_android image_picker_for_web image_picker_ios image_picker_linux image_picker_macos image_picker_platform_interface image_picker_windows]
- in_app_purchase 3.2.0 [flutter in_app_purchase_android in_app_purchase_platform_interface in_app_purchase_storekit]
- intl 0.20.2 [clock meta path]
- json_annotation 4.9.0 [meta]
- path_provider 2.1.5 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows]
- permission_handler 12.0.1 [flutter meta permission_handler_android permission_handler_apple permission_handler_html permission_handler_windows permission_handler_platform_interface]
- quiver 3.2.2 [matcher]
- rate_my_app 2.3.2 [shared_preferences flutter_rating_bar flutter]
- rect_getter 1.1.0 [flutter]
- rxdart 0.28.0
- share_plus 12.0.1 [cross_file meta mime flutter flutter_web_plugins share_plus_platform_interface file url_launcher_web url_launcher_windows url_launcher_linux url_launcher_platform_interface ffi web win32]
- shared_preferences 2.5.4 [flutter shared_preferences_android shared_preferences_foundation shared_preferences_linux shared_preferences_platform_interface shared_preferences_web shared_preferences_windows]
- timezone 0.10.1 [http path]
- universal_html 2.3.0 [async csslib charcode collection html meta source_span typed_data universal_io]
- url_launcher 6.3.2 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows]
- webview_flutter 4.13.1 [flutter webview_flutter_android webview_flutter_platform_interface webview_flutter_wkwebview]

dev dependencies:
- build_runner 2.10.3 [analyzer args async build build_config build_daemon built_collection built_value code_builder collection convert crypto dart_style glob graphs http_multi_server io json_annotation logging meta mime package_config path pool pub_semver shelf shelf_web_socket stream_transform watcher web_socket_channel yaml]                                                                                                                                                                                         
- emulators 0.5.1 [elemental freezed_annotation json_annotation path]
- flutter_launcher_icons 0.13.1 [args checked_yaml cli_util image json_annotation path yaml]
- flutter_test 0.0.0 [flutter test_api matcher path fake_async clock stack_trace vector_math leak_tracker_flutter_testing collection meta stream_channel]
- integration_test 0.0.0 [flutter flutter_driver flutter_test path vm_service]
- json_serializable 6.11.1 [analyzer async build build_config dart_style json_annotation meta path pub_semver pubspec_parse source_gen source_helper]
- test 1.30.0 [analyzer async boolean_selector collection coverage http_multi_server io matcher node_preamble package_config path pool shelf shelf_packages_handler shelf_static shelf_web_socket source_span stack_trace stream_channel test_api test_core typed_data web_socket_channel webkit_inspection_protocol yaml]                                                                                                                                                                                                        

transitive dependencies:
- _fe_analyzer_shared 91.0.0 [meta]
- _flutterfire_internals 1.3.67 [collection firebase_core firebase_core_platform_interface flutter meta]
- analyzer 8.4.1 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml]
- app_links_linux 1.0.3 [flutter app_links_platform_interface gtk]
- app_links_platform_interface 2.0.2 [flutter plugin_platform_interface]
- app_links_web 1.0.4 [flutter flutter_web_plugins app_links_platform_interface web]
- archive 4.0.7 [crypto path posix]
- args 2.7.0
- async 2.13.0 [collection meta]
- boolean_selector 2.1.2 [source_span string_scanner]
- build 4.0.2 [analyzer crypto glob logging package_config path]
- build_config 1.2.0 [checked_yaml json_annotation path pubspec_parse]
- build_daemon 4.1.1 [built_collection built_value crypto http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel]
- built_collection 5.1.1
- built_value 8.12.0 [built_collection collection fixnum meta]
- cached_network_image_platform_interface 4.1.1 [flutter flutter_cache_manager]
- cached_network_image_web 1.3.1 [cached_network_image_platform_interface flutter flutter_cache_manager web]
- characters 1.4.1
- charcode 1.4.0
- checked_yaml 2.0.4 [json_annotation source_span yaml]
- cli_config 0.2.0 [args yaml]
- cli_util 0.4.2 [meta path]
- clock 1.1.2
- code_builder 4.11.0 [built_collection built_value collection matcher meta]
- convert 3.1.2 [typed_data]
- coverage 1.15.0 [args cli_config glob logging meta package_config path source_maps stack_trace vm_service yaml]
- cross_file 0.3.5 [meta web]
- crypto 3.0.7 [typed_data]
- csslib 1.0.2 [source_span]
- dart_style 3.1.3 [analyzer args collection package_config path pub_semver source_span yaml]
- dbus 0.7.11 [args ffi meta xml]
- elemental 0.1.2 [fast_immutable_collections fpdart meta nucleus]
- equatable 2.0.7 [collection meta]
- fake_async 1.3.3 [clock collection]
- fast_immutable_collections 9.2.1 [collection meta]
- ffi 2.1.4
- file_selector_linux 0.9.3+2 [cross_file file_selector_platform_interface flutter]
- file_selector_macos 0.9.4+5 [cross_file file_selector_platform_interface flutter]
- file_selector_platform_interface 2.7.0 [cross_file flutter http plugin_platform_interface]
- file_selector_windows 0.9.3+4 [cross_file file_selector_platform_interface flutter]
- firebase_analytics_platform_interface 5.0.7 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
- firebase_analytics_web 0.6.1+3 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins]
- firebase_auth_platform_interface 8.1.7 [_flutterfire_internals collection firebase_core flutter http meta plugin_platform_interface]
- firebase_auth_web 6.1.3 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser meta web]
- firebase_core_platform_interface 6.0.2 [collection flutter flutter_test meta plugin_platform_interface]
- firebase_core_web 3.5.0 [firebase_core_platform_interface flutter flutter_web_plugins meta web]
- firebase_crashlytics_platform_interface 3.8.18 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- firebase_database_platform_interface 0.3.0+3 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- firebase_database_web 0.2.7+4 [collection firebase_core firebase_core_web firebase_database_platform_interface flutter flutter_web_plugins]
- firebase_storage_platform_interface 5.2.18 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- firebase_storage_web 3.11.3 [_flutterfire_internals async firebase_core firebase_core_web firebase_storage_platform_interface flutter flutter_web_plugins http meta web]
- fixnum 1.1.1
- flutter_cache_manager 3.4.1 [clock collection file flutter http path path_provider rxdart sqflite uuid]
- flutter_driver 0.0.0 [file flutter flutter_test fuchsia_remote_debug_protocol path meta vm_service webdriver matcher]
- flutter_local_notifications_linux 6.0.0 [dbus ffi flutter flutter_local_notifications_platform_interface path xdg_directories]
- flutter_local_notifications_platform_interface 9.1.0 [plugin_platform_interface]
- flutter_local_notifications_windows 1.0.3 [flutter ffi flutter_local_notifications_platform_interface meta timezone xml]
- flutter_plugin_android_lifecycle 2.0.32 [flutter]
- flutter_rating_bar 4.0.1 [flutter]
- flutter_web_plugins 0.0.0 [flutter]
- fpdart 1.2.0
- freezed_annotation 3.1.0 [collection json_annotation meta]
- frontend_server_client 4.0.0 [async path]
- fuchsia_remote_debug_protocol 0.0.0 [process vm_service meta]
- gettext_parser 0.2.0
- glob 2.1.3 [async collection file path string_scanner]
- google_identity_services_web 0.3.3+1 [meta web]
- google_sign_in_android 7.2.4 [flutter google_sign_in_platform_interface]
- google_sign_in_ios 6.2.3 [flutter google_sign_in_platform_interface]
- google_sign_in_platform_interface 3.1.0 [flutter plugin_platform_interface]
- google_sign_in_web 1.1.0 [flutter flutter_web_plugins google_identity_services_web google_sign_in_platform_interface http web]
- graphs 2.3.2 [collection]
- gtk 2.1.0 [ffi flutter meta]
- html 0.15.6 [csslib source_span]
- http_multi_server 3.2.2 [async]
- http_parser 4.1.2 [collection source_span string_scanner typed_data]
- i18n_extension_core 5.0.2 [sprintf]
- image 4.5.4 [archive meta xml]
- image_picker_android 0.8.13+7 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface]
- image_picker_for_web 3.1.0 [flutter flutter_web_plugins image_picker_platform_interface mime web]
- image_picker_ios 0.8.13+1 [flutter image_picker_platform_interface]
- image_picker_linux 0.2.2 [file_selector_linux file_selector_platform_interface flutter image_picker_platform_interface]
- image_picker_macos 0.2.2+1 [file_selector_macos file_selector_platform_interface flutter image_picker_platform_interface]
- image_picker_platform_interface 2.11.1 [cross_file flutter http plugin_platform_interface]
- image_picker_windows 0.2.2 [file_selector_platform_interface file_selector_windows flutter image_picker_platform_interface]
- in_app_purchase_android 0.3.6+13 [collection flutter in_app_purchase_platform_interface json_annotation]
- in_app_purchase_platform_interface 1.4.0 [flutter plugin_platform_interface]
- in_app_purchase_storekit 0.3.22+1 [collection flutter in_app_purchase_platform_interface json_annotation]
- io 1.0.5 [meta path string_scanner]
- leak_tracker 11.0.2 [clock collection meta path vm_service]
- leak_tracker_flutter_testing 3.0.10 [flutter leak_tracker leak_tracker_testing matcher meta]
- leak_tracker_testing 3.0.2 [leak_tracker matcher meta]
- logging 1.3.0
- matcher 0.12.19 [async meta stack_trace term_glyph test_api]
- material_color_utilities 0.13.0 [collection]
- meta 1.17.0
- mime 2.0.0
- node_preamble 2.0.2
- nucleus 0.4.1
- octo_image 2.1.0 [flutter]
- package_config 2.2.0 [path]
- path 1.9.1
- path_provider_android 2.2.20 [flutter path_provider_platform_interface]
- path_provider_foundation 2.4.3 [flutter path_provider_platform_interface]
- path_provider_linux 2.2.1 [ffi flutter path path_provider_platform_interface xdg_directories]
- path_provider_platform_interface 2.1.2 [flutter platform plugin_platform_interface]
- path_provider_windows 2.3.0 [ffi flutter path path_provider_platform_interface]
- permission_handler_android 13.0.1 [flutter permission_handler_platform_interface]
- permission_handler_apple 9.4.7 [flutter permission_handler_platform_interface]
- permission_handler_html 0.1.3+5 [flutter flutter_web_plugins permission_handler_platform_interface web]
- permission_handler_platform_interface 4.3.0 [flutter meta plugin_platform_interface]
- permission_handler_windows 0.2.1 [flutter permission_handler_platform_interface]
- petitparser 7.0.1 [meta collection]
- platform 3.1.6
- plugin_platform_interface 2.1.8 [meta]
- pool 1.5.2 [async stack_trace]
- posix 6.0.3 [ffi meta path]
- process 5.0.5 [file path platform]
- pub_semver 2.2.0 [collection]
- pubspec_parse 1.5.0 [checked_yaml collection json_annotation pub_semver yaml]
- share_plus_platform_interface 6.1.0 [cross_file flutter meta mime plugin_platform_interface path_provider uuid]
- shared_preferences_android 2.4.15 [flutter shared_preferences_platform_interface]
- shared_preferences_foundation 2.5.5 [flutter shared_preferences_platform_interface]
- shared_preferences_linux 2.4.1 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface]
- shared_preferences_platform_interface 2.4.1 [flutter plugin_platform_interface]
- shared_preferences_web 2.4.3 [flutter flutter_web_plugins shared_preferences_platform_interface web]
- shared_preferences_windows 2.4.1 [file flutter path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface]
- shelf 1.4.2 [async collection http_parser path stack_trace stream_channel]
- shelf_packages_handler 3.0.2 [path shelf shelf_static]
- shelf_static 1.1.3 [convert http_parser mime path shelf]
- shelf_web_socket 3.0.0 [shelf stream_channel web_socket_channel]
- sky_engine 0.0.0
- source_gen 4.0.2 [analyzer async build dart_style glob path pub_semver source_span yaml]
- source_helper 1.3.8 [analyzer source_gen]
- source_map_stack_trace 2.1.2 [path source_maps stack_trace]
- source_maps 0.10.13 [source_span]
- source_span 1.10.1 [collection path term_glyph]
- sprintf 7.0.0
- sqflite 2.4.2 [flutter sqflite_android sqflite_darwin sqflite_platform_interface sqflite_common path]
- sqflite_android 2.4.2+2 [flutter sqflite_common path sqflite_platform_interface]
- sqflite_common 2.5.6 [synchronized path meta]
- sqflite_darwin 2.4.2 [flutter sqflite_platform_interface meta sqflite_common path]
- sqflite_platform_interface 2.4.0 [flutter platform sqflite_common plugin_platform_interface meta]
- stack_trace 1.12.1 [path]
- stream_channel 2.1.4 [async]
- stream_transform 2.1.1
- string_scanner 1.4.1 [source_span]
- sync_http 0.3.1
- synchronized 3.4.0
- term_glyph 1.2.2
- test_api 0.7.10 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph]
- test_core 0.6.16 [analyzer args async boolean_selector collection coverage frontend_server_client glob io meta package_config path pool source_map_stack_trace source_maps source_span stack_trace stream_channel test_api vm_service yaml]
- typed_data 1.4.0 [collection]
- universal_io 2.3.1 [collection meta typed_data]
- url_launcher_android 6.3.24 [flutter url_launcher_platform_interface]
- url_launcher_ios 6.3.5 [flutter url_launcher_platform_interface]
- url_launcher_linux 3.2.1 [flutter url_launcher_platform_interface]
- url_launcher_macos 3.2.4 [flutter url_launcher_platform_interface]
- url_launcher_platform_interface 2.3.2 [flutter plugin_platform_interface]
- url_launcher_web 2.4.1 [flutter flutter_web_plugins url_launcher_platform_interface web]
- url_launcher_windows 3.1.4 [flutter url_launcher_platform_interface]
- uuid 4.5.2 [crypto meta fixnum]
- vector_math 2.2.0
- vm_service 15.0.2
- watcher 1.1.4 [async path]
- web 1.1.1
- web_socket 1.0.1 [web]
- web_socket_channel 3.0.3 [async crypto stream_channel web web_socket]
- webdriver 3.1.0 [matcher path stack_trace sync_http]
- webkit_inspection_protocol 1.2.1 [logging]
- webview_flutter_android 4.10.13 [flutter meta webview_flutter_platform_interface]
- webview_flutter_platform_interface 2.14.0 [flutter meta plugin_platform_interface]
- webview_flutter_wkwebview 3.24.1 [flutter meta path webview_flutter_platform_interface]
- win32 5.15.0 [ffi]
- xdg_directories 1.1.0 [meta path]
- xml 6.6.1 [collection meta petitparser]
- yaml 3.1.3 [collection source_span string_scanner]

Additional context and comments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions