Skip to content

Decode error in account last_synced_at #578

@josefinalliende

Description

@josefinalliende

Context

When I run the app in ios emulator (that had data before the big plans PR in flutter side) I get this error:

flutter: The following _$ApiError_WhitenoiseImpl was thrown initialize:
flutter: ApiError.whitenoise(message: Database error: SQLx error: error occurred while decoding column
flutter: "last_synced_at": mismatched types; Rust type `core::option::Option<i64>` (as SQL type `INTEGER`) is
flutter: not compatible with SQL type `TEXT`)
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #0      SimpleDecoder.decode (package:flutter_rust_bridge/src/codec/base.dart:32:9)
flutter: #1      SseCodec._decode (package:flutter_rust_bridge/src/codec/sse.dart:45:55)
flutter: #2      SseCodec.decodeObject (package:flutter_rust_bridge/src/codec/sse.dart:35:12)

Steps to reproduce

Solution?

  • I suspect the issue comes from the conversion in accounts.rs:
    pub last_synced_at: Option<DateTime<Utc>>
  • Not sure yet whether the fix should be on the Flutter side, the Rust side, or both.
  • This issue is mainly to investigate why this mismatch is happening and decide where the fix belongs.

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions