Zaid-Ajaj / Fable.Remoting

Type-safe communication layer (RPC-style) for F# featuring Fable and .NET Apps
https://zaid-ajaj.github.io/Fable.Remoting/
MIT License
272 stars 54 forks source link

Binary serialization bug with Result.Error #304

Closed sWW26 closed 2 years ago

sWW26 commented 2 years ago

I'm getting some weird behaviour when using binary serialization with the Result type when the Error contains a string.

I've had a brief poke around to see if I can repro it using only the Fable.Remoting.MsgPack library directly however that seems to work fine. It only seems to happen when going through the proxy / Giraffe?

I've put together a little sample app here that shows the issue: https://github.com/sWW26/FableBinarySerializationBug

The API always returns Error "Test" however the string ends up getting mangled. image

kerams commented 2 years ago

Will take a look.

kerams commented 2 years ago

Very strange - the first 2 responses contain corrupted (?) data. From the 3rd onwards, everything seems to be OK. Doesn't ring any bells, so I'll have to sleep on this.

kerams commented 2 years ago

@sWW26, I've managed to ascertain this issue is deeper than Remoting. Could be due to JIT, but F# codegen is more likely. Follow the progress here https://github.com/dotnet/fsharp/issues/13447.

sWW26 commented 2 years ago

Thanks for investigating!

Zaid-Ajaj commented 2 years ago

Closing as fixed since latest Fable.Remoting.MsgPack v1.18.0