When a document is saved with a value as NaN, the serde_json encodes it as null however it is then unable to decode it per serde-rs/json#202. This is not ideal as users have to manually edit the JSON to recover their document.
Apparently we can get NaN values in the handle_end field of SegmentModification. It is not clear how this occurs. Some asserts when updating these values should allow for better debugging if this occurs again.
It may also be prudent to consider checking the document for NaN values before saving. Furthermore, a better data format (not JSON) might allow roundtripping all data values. This could be considered as part of #1742.
As reported by ananas_tya on discord.
When a document is saved with a value as
NaN, theserde_jsonencodes it asnullhowever it is then unable to decode it per serde-rs/json#202. This is not ideal as users have to manually edit the JSON to recover their document.Apparently we can get
NaNvalues in thehandle_endfield ofSegmentModification. It is not clear how this occurs. Some asserts when updating these values should allow for better debugging if this occurs again.It may also be prudent to consider checking the document for NaN values before saving. Furthermore, a better data format (not JSON) might allow roundtripping all data values. This could be considered as part of #1742.
As reported by ananas_tya on discord.