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.68k stars 3.97k forks source link

[firebase_data_connect]: Timestamp Dynamic Deserializer #13541

Open Nianmi opened 9 hours ago

Nianmi commented 9 hours ago

Is there an existing issue for this?

Which plugins are affected?

Database

Which platforms are affected?

Android, iOS, macOS

Description

When generating dart files from data connect i get this compiler error The argument type 'Timestamp Function(String)' can't be assigned to the parameter type 'DynamicDeserializer<Timestamp>'.

I used the timestamp in my query inside the where statement.

query GetDataViaTimestamp($iD: String, $startDate: Timestamp)
@auth(level: USER) {
  sensorDatas(
    where: {
      _and: [
        { sensorID: { eq: $iD} }
        { timestamp: { ge: $startDate } }
      ]
    }
    orderBy: { timestamp: DESC }
  ) {
timestamp
...
  }
}

Table Schema looks like this:

type SensorData @table(name: "sensor_data",  key: ["timestamp", "sensorID"]) {
    timestamp: Timestamp!
    sensorID: Sensor!
    ...
}

Reproducing the issue

  1. Create a table with timestamp as a primary key and some other columns
  2. Fill the table with data
  3. Create a query with the timestamp inside the where part of the query
  4. generate the connector for dart
  5. Error should appear inside the dart query file

Firebase Core version

3.6.0

Flutter Version

3.24.3

Relevant Log Output

The argument type 'Timestamp Function(String)' can't be assigned to the parameter type 'DynamicDeserializer<Timestamp>'.

Flutter dependencies

Expand Flutter dependencies snippet
```yaml Dart SDK 3.5.3 Flutter SDK 3.24.3 datqa_connect_test 0.1.0 dependencies: - firebase_core 3.6.0 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_data_connect 0.1.2+1 [firebase_app_check firebase_auth firebase_core firebase_core_platform_interface flutter grpc http intl protobuf] - flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine] dev dependencies: - flutter_lints 4.0.0 [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.44 [collection firebase_core firebase_core_platform_interface flutter meta] - archive 3.6.1 [crypto path] - args 2.6.0 - 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 - crypto 3.0.6 [typed_data] - fake_async 1.3.1 [clock collection] - firebase_app_check 0.3.1+4 [firebase_app_check_platform_interface firebase_app_check_web firebase_core firebase_core_platform_interface flutter] - firebase_app_check_platform_interface 0.1.0+38 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_app_check_web 0.2.0 [_flutterfire_internals firebase_app_check_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins web] - firebase_auth 5.3.1 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta] - firebase_auth_platform_interface 7.4.7 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_auth_web 5.13.2 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser meta web] - firebase_core_platform_interface 5.3.0 [collection flutter flutter_test meta plugin_platform_interface] - firebase_core_web 2.18.1 [firebase_core_platform_interface flutter flutter_web_plugins meta web] - fixnum 1.1.1 - flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math] - google_identity_services_web 0.3.1+4 [meta web] - googleapis_auth 1.6.0 [args crypto google_identity_services_web http http_parser] - grpc 3.2.4 [archive async crypto fixnum googleapis_auth meta http http2 protobuf clock] - http 1.2.2 [async http_parser meta web] - http2 2.3.0 - http_parser 4.0.2 [collection source_span string_scanner typed_data] - intl 0.19.0 [clock meta path] - leak_tracker 10.0.5 [clock collection meta path vm_service] - leak_tracker_flutter_testing 3.0.5 [flutter leak_tracker leak_tracker_testing matcher meta] - leak_tracker_testing 3.0.1 [leak_tracker matcher meta] - lints 4.0.0 - matcher 0.12.16+1 [async meta stack_trace term_glyph test_api] - material_color_utilities 0.11.1 [collection] - meta 1.15.0 - path 1.9.0 - plugin_platform_interface 2.1.8 [meta] - protobuf 3.1.0 [collection fixnum 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.7.2 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph] - typed_data 1.4.0 [collection] - vector_math 2.1.4 - vm_service 14.2.5 - web 1.1.0 ```

Additional context and comments

No response

maneesht commented 2 hours ago

Thanks for flagging this! We're working on the issue and hope to have the fix in next week.