Builder: unsaved work can be lost without a prompt, because dirty is set by published events rather than by the edit itself
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- C
- スター
- 10
- フォーク
- 8
- 平均マージ
- 6時間 32分
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
FriendsofECCE/ECCE のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
FriendsofECCE/ECCE#1358 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
FriendsofECCE/ECCE#1353 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
FriendsofECCE/ECCE#1348 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
FriendsofECCE/ECCE#1347 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
FriendsofECCE/ECCE#1345 ·
FriendsofECCE/ECCE の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
vincentarelbundock/xtx#11 ·
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
compiler-explorer/compiler-explorer#9738 ·
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 3 日以内に返信
-
[Android Auto] MU1017 (MHI2Q_JP_AUG22_P1017) cluster map works with a pinned profile — values insideオープン
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
kamgurgul/mib2q-carplay#74 ·