Open srid opened 10 months ago
Is this still an issue @srid ?
I'll check this after doing https://github.com/juspay/nix-browser/issues/125
We still use postcard
. Postcard doesn't support all of serde's features
I just got bit by this, but mine was a bit more annoying to track down. Currently no error is logged upon a deserialization failure, rather the error just gets .ok()
ed into a None
, so that the provided default init()
value overwrites the problematic stored value. I modified dioxus-sdk
locally to find an unexpected EOF deserialization error. This was caused by using the serde attribute deserialize_with
on a struct field.
Can we replace the postcard
serialization with just serde_json
? Or perhaps offer json storage via feature flag?
We should switch to cbor or bincode which are binary encoding formats that support more serde features
cbor
would be better for binary sizes because it is already pulled in for fullstack
See https://github.com/DioxusLabs/dioxus-std/pull/17#issuecomment-1800687581 for the original issue wherein I reported that #17's use of
postcard
fails to deserialize certain types from disk ontoSignal
s.Here's a simple type that will trigger postcard's
WontImplement
error:Here's the code to reproduce:
Run the app, then quit and run it again, the console should print:
If we remove the
#[serde(untagged)]
, the code works as expected. Turns out we are not the first to notice this issue withpostcard
:https://github.com/jamesmunns/postcard/issues/92