fix(fe): handle JSON-stringified fields from backend in message deserialization

Backend returns metadata, ai_moderation_flags, and ai_categories as raw
JSON strings (PostgreSQL JSONB cast to string). Frontend expected parsed
structs/arrays, causing serde to fail silently — entire PageResult parse
failed and user saw empty message list with no error indicator.

Add custom deserialize_with handler (from_json_string_or_value) that
transparently handles null / direct value / JSON-string cases for the
three affected fields.
This commit is contained in:
asepharyana
2026-07-04 09:10:32 +07:00
parent efb1f4e4a5
commit e73abf596d
3 changed files with 59 additions and 3 deletions
+1
View File
@@ -1883,6 +1883,7 @@ name = "shared-types"
version = "0.1.0"
dependencies = [
"serde",
"serde_json",
]
[[package]]