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

Float values with NaN lead to silent deserialisation errors on the client #221

Closed danyx23 closed 3 years ago

danyx23 commented 3 years ago

I just used Fable.Remoting in the standard current SAFE stack setup to request some values from the server. I later realized that some of the float values were NaN values on the server side but was scratching my head for some time because in the network tab in the browser I saw a successful response as expected but then I never got the success message of the Cmd.OfAsync.perform style command that was sent.

I switched my model to use float options and coerced NaN values to None which fixed the problem, but I think it would be nice if this were taken care of automatically.

Let me know if you have a preference for how to solve this and if you like I could help with the implementation. Thanks for the great library!

Zaid-Ajaj commented 3 years ago

Hi there @danyx23, thanks for reporting the issue. If you say, the client is failing to deserialize the values, then the issue is probably upstream in Fable.SimpleJson the client uses underneath for deserialization. I have will have a look and let you know of my findings

Zaid-Ajaj commented 3 years ago

Can you update Fable.Remoting.Client from v7.2 to v7.3 and confirm that the issue is fixed? Thanks :smile:

danyx23 commented 3 years ago

Hi @Zaid-Ajaj, yes, issue fixed. Thanks a lot!

Zaid-Ajaj commented 3 years ago

Awesome! Thanks for letting me know 🙏 btw you can upgrade Remoting.Client to v7.4 which fixed another issue with nuget that you may or may not have but just in case 😉