GraphiteEditor / GraphiteEditor/Graphite

NaN point causes document not to deserialize

Abierto
#4,432 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Rust
Estrellas
27.2k
Forks
1.3k
Merge medio
20 h 5 min
PR fusionados (30 d)
57

Descripción

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).

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
rust
Área
backend, data
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Tranquilo
Claridad
Necesita aclaración
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.