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

TimeSpan Greater than 2,147,483,647 ms throws error #276

Closed matthewcrews closed 2 years ago

matthewcrews commented 2 years ago

The parsing of the TimeSpan type is transferring the value in terms of number of milliseconds stored as int. This will cause an error when trying to make an RPC call with a TimeSpan who's number of milliseconds exceed the range of int.

I believe the issue is here: https://github.com/Zaid-Ajaj/Fable.Remoting/blob/726303ce60a7e24e9d50fbd83ecac82fe42af143/Fable.Remoting.Json/FableConverter.fs#L491

I believe that it can be fixed by converting to a float instead of an int. I believe this per the docs here: https://docs.microsoft.com/en-us/dotnet/api/system.timespan.frommilliseconds?view=net-5.0

I will see if I can create my own PR to address the issue. I'll reference this issue in the PR.

Zaid-Ajaj commented 2 years ago

Fixed in #277 thanks again 🙏 I'll add some integration tests later for this