Closed kevygreen closed 3 years ago
@mcollina This should resolve the build issues that were introduced in the PR #76 as well.
New option timestamp96ThrowRangeEx to throw errors in invalid cases. Default behavior is to trim precision without throwing an error
Is this new option needed to solve the build issues?
The option timestamp96ThrowRangeEx is used to handle the behaviour of edge cases as I emailed you about:
JavaScript Date object doesn’t support the same range and precision as the msgPack timestamp 96. As such, what should happen if you try to deserialize a value that can’t be handled in a JavaScript Date?
Case 1 - Date too large/small Option 1 – Throw “out of range” exception Option 2 – Use Max/Min JavaScript Date (DEFAULT)
Case 2 - Nanoseconds too precise Option 1 – Throw “too precise” exception Option 2 – Round nanoseconds to the closest value (DEFAULT)
Case3 - Nanoseconds invalid e.g. > 999999999 Option 1 – Throw exception
I'm going to land https://github.com/mcollina/msgpack5/pull/78 first. You might have to rebase afterwards.
Would you mind rebasing? Sorry for this, the other one was waiting.
When working with SignalR Core and MessagePack-CSharp this should now let you handle C#'s full range.