GraphiteEditor / GraphiteEditor/Graphite
NaN point causes document not to deserialize
- Langage dominant
- Rust
- Étoiles
- 27.2k
- Forks
- 1.3k
- Merge moyen
- 20 h 5 min
- PR mergées (30 j)
- 57
Description
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).
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- rust
- Domaine
- backend, data
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- Calme
- Clarté
- À clarifier
- Accessibilité débutants
- 35/100