Builder: unsaved work can be lost without a prompt, because dirty is set by published events rather than by the edit itself
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
Línea de trabajo
Audit undoable commands under src/viz/sgcommands and other structure-changing commands, comparing their published GeomChange, ResidueChange and LatticeChange events with the dirty flag handling in Builder::eventMCB and Builder::execute. First establish whether any current editing command omits those events; then assess whether marking successful undoable commands dirty would also affect selection, camera or display-style commands. Done means the audit identifies whether this is a live data-loss bug and whether the proposed change avoids marking non-editing commands dirty.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Found while investigating why a Builder that was never edited asks to save (#1279 W5.4).
Builder marks itself modified only on the events ResidueChange, GeomChange and LatticeChange (Builder::eventMCB), plus constraintsEdited and the script charge command. Builder::execute does NOT set the flag for a successful undoable command. Instead every editing command publishes GeomChange itself - AddFragmentCmd, DeleteCmd, CleanCmd, AtomEditCmd and the rest each do it individually.
So the flag depends on each command remembering to announce itself. Any editing command that does not publish leaves the Builder believing it is unmodified, and the user is then allowed to close it with no prompt and lose the work. There is no mechanism that would catch such an omission: nothing fails, nothing is logged, and the only symptom is work quietly disappearing.
This is the inverse of the symptom that led here. #1279 W5.4 is a Builder asking to save when nothing was edited; the same design allows a Builder not to ask when something was.
What needs establishing first: whether the hole is theoretical or actual. Audit the undoable commands under src/viz/sgcommands (and any other command that changes the structure) against the set that publishes GeomChange/ResidueChange/LatticeChange. If every current command publishes, this is a latent trap for the next command somebody writes. If any does not, it is a live data-loss bug and needs a severity to match.
Proposed fix, from the same reading: set the flag in Builder::execute when a command succeeds and is undoable, so that marking the document modified follows from editing it rather than from a separate announcement. That is roughly a one-line change, but it is a design change rather than a patch - it would want checking against commands that are undoable without being edits (selection, camera, display style), which must not mark the structure modified.
Related: #1279 (where this was found), and the cross-calculation event question in the same investigation - the Builders event receiver does not check which calculation published the event, so in one-program mode a Viewer tab may dirty a Builder tab of a different calculation.
- Lenguaje dominante
- C
- Estrellas
- 10
- Forks
- 8
- Merge medio
- 6 h 32 min
- PR fusionados (30 d)
- 1
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de FriendsofECCE/ECCE
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
FriendsofECCE/ECCE#1358 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
FriendsofECCE/ECCE#1353 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
FriendsofECCE/ECCE#1348 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
FriendsofECCE/ECCE#1347 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
FriendsofECCE/ECCE#1345 ·
Todos los issues de FriendsofECCE/ECCE
Issues similares
-
Installation fails from source: missing libintl.h on macOS, undeclared R_typeToChar() on R 4.6Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
vincentarelbundock/xtx#11 ·
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
compiler-explorer/compiler-explorer#9738 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 3 días
-
[Android Auto] MU1017 (MHI2Q_JP_AUG22_P1017) cluster map works with a pinned profile — values insideAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
kamgurgul/mib2q-carplay#74 ·