GraphiteEditor / GraphiteEditor/Graphite
NaN point causes document not to deserialize
- 主要言語
- Rust
- スター
- 27.2k
- フォーク
- 1.3k
- 平均マージ
- 20時間 5分
- マージ済み PR(30日)
- 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).
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
Start by tracing document serialization through serde_json and investigating how SegmentModification.handle_end can contain NaN values. Reproduce the save-and-deserialize failure, then determine whether the fix should validate before saving, improve diagnostics, or address the broader format concern in #1742. Done means the chosen behavior is defined and covered by regression checks.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- rust
- 領域
- backend, data
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 35/100