GraphiteEditor / GraphiteEditor/Graphite
NaN point causes document not to deserialize
- 主要语言
- Rust
- 星标
- 27.2k
- 派生
- 1.3k
- 平均合并
- 20 小时 5 分钟
- 30 天内合并 PR
- 57
描述
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 https://github.com/serde-rs/json/issues/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](https://discord.com/channels/731730685944922173/1134981447539761273/1537123590460145674).
贡献指南
这个仓库没有索引到贡献指南
调研方向
首先跟踪通过 serde_json 进行的文档序列化,并调查 SegmentModification.handle_end 如何包含 NaN 值。重现保存和反序列化失败的问题,然后确定修复方案应在保存前进行验证、改进诊断,还是处理 #1742 中更广泛的格式问题。选定的行为得到定义并由回归检查覆盖后,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- rust
- 领域
- backend, data
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 冷清
- 描述清晰度
- 需要澄清
- 新手友好度
- 35/100