Skip to content

🐛 [firebase_database] MissingPluginException with certain unicode characters in filter #9587

@juaoose

Description

@juaoose

Bug report

Describe the bug
Whenever using the orderByChild(), startAt() and endAt() combination to filter data with some unicode characters such as \u{0000} and \u{FFFF}, a MissingPluginException is thrown. This happens when listening for data with onValue but not when executing the query with get().

The exception thrown is:

══╡ EXCEPTION CAUGHT BY SERVICES LIBRARY ╞══════════════════════════════════════════════════════════
The following MissingPluginException was thrown while activating platform stream on channel
streamers-[DEFAULT]-null-DatabaseEventType.value-[{type: orderBy, name: orderByChild, path:
activeSessionId}, {type: cursor, name: startAt, value: }, {type: cursor, name: endAt, value: �}]#0:
MissingPluginException(No implementation found for method listen on channel
streamers-[DEFAULT]-null-DatabaseEventType.value-[{type: orderBy, name: orderByChild, path:
activeSessionId}, {type: cursor, name: startAt, value: }, {type: cursor, name: endAt, value: �}]#0)

When the exception was thrown, this was the stack:
#0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:294:7)
<asynchronous suspension>
#1      EventChannel.receiveBroadcastStream.<anonymous closure> (package:flutter/src/services/platform_channel.dart:637:9)
<asynchronous suspension>
════════════════════════════════════════════════════════════════════════════════════════════════════

Steps to reproduce

Steps to reproduce the behavior:

  1. Set up a query with orderByChild("someChild"), startAt("\u{0000}") and endAt("\u{FFFF}").
  2. Listen to data using onValue and the created query, the exception will be thrown.

Expected behavior

The listener should not raise this exception and instead return data.

Sample project

https://github.com/juaoose/db_sample/blob/main/lib/main.dart#L47


Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.3.1, on Microsoft Windows [Version 10.0.22000.856], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components
[!] Android Studio (not installed)
[√] Connected device (4 available)
[√] HTTP Host Availability

! Doctor found issues in 2 categories.

Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand
Dart SDK 2.18.0
Flutter SDK 3.3.1
db_sample 1.0.0+1

dependencies:
- cupertino_icons 1.0.5
- firebase_core 1.22.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_database 9.1.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 2.0.1 [lints]
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters collection matcher material_color_utilities meta source_span stream_channel string_scanner term_glyph]

transitive dependencies:
- async 2.9.0 [collection meta]
- boolean_selector 2.1.0 [source_span string_scanner]
- characters 1.2.1
- clock 1.1.1
- collection 1.16.0
- fake_async 1.3.1 [clock collection]
- firebase_core_platform_interface 4.5.1 [collection flutter flutter_test meta plugin_platform_interface]
- firebase_core_web 1.7.2 [firebase_core_platform_interface flutter flutter_web_plugins js meta]
- firebase_database_platform_interface 0.2.2+4 [collection firebase_core flutter meta plugin_platform_interface]
- firebase_database_web 0.2.1+6 [firebase_core firebase_core_web firebase_database_platform_interface flutter flutter_web_plugins js]
- flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta vector_math]
- js 0.6.4
- lints 2.0.0
- matcher 0.12.12 [stack_trace]
- material_color_utilities 0.1.5
- meta 1.8.0
- path 1.8.2
- plugin_platform_interface 2.1.3 [meta]
- sky_engine 0.0.99
- source_span 1.9.0 [collection path term_glyph]
- stack_trace 1.10.0 [path]
- stream_channel 2.1.0 [async]
- string_scanner 1.1.1 [source_span]
- term_glyph 1.2.1
- test_api 0.4.12 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher]
- vector_math 2.1.2

Metadata

Metadata

Assignees

Labels

Needs AttentionThis issue needs maintainer attention.platform: androidIssues / PRs which are specifically for Android.platform: iosIssues / PRs which are specifically for iOS.plugin: databaseresolution: fixedA fix has been merged or is pending merge from a PR.type: bugSomething isn't workingtype: crashA compile error or crash

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions