Builder: doSave() writes into a read-only (run) calculation and resets its state to Created

未關閉 適合新手
#1,138 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
74/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
c

研究方向

閱讀src/apps/builder/Builder.C中Builder::doSave()附近的程式碼,並將其行為與用來停用 File > Save 的唯讀檢查進行比較。issue 也指出了src/dsm/edsiimpl/ChemistryTask.C中的ChemistryTask::fragment(),它會將狀態變更為 Created。請確認唯讀計算無法透過直接的save hook 儲存,且其狀態維持不變。

由索引模型根據 Issue 內容生成。

描述

Where: `Builder::doSave()` (src/apps/builder/Builder.C) has no read-only check. File > Save is disabled for a read-only calculation (state Submitted or later, `PropertyTask::isReadOnly`), but a direct caller of `doSave()` still saves the structure through `ChemistryTask::fragment()`, which then sets the state to Created (src/dsm/edsiimpl/ChemistryTask.C, end of `fragment`). A run calculation, with its outputs and properties, becomes an editable, unrun calculation without any question.

Repro (hooks, one program, isolated home):

  1. Organizer `ECCE_TEST_ORGANIZER`: `examples`, then `start Builder file:///users/local/Examples/Getting_Started/ammonia` (a stored MOPAC run, state Loaded).
  2. `ECCE_BUILDER_SCRIPT`: `wait 20000`, `savestate` (dirty=0 save_enabled=0: read-only), `save`, `wait 3000`, `savestate`.
  3. The calculation's `.ecce-meta` now has `state Created`. Any later edit marks it dirty and enables Save.

Today only the `save` script hook reaches this path; the menu, toolbar and Ctrl+S are disabled. Found while diagnosing #1137.

Expected: `doSave()` refuses on a read-only calculation (as the menu does), or the `save` hook goes through the menu's enable state (`savemenu` already does).

主要語言
C
星號
10
分支
8
PR 合併指標
30 天內沒有已合併 PR

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

FriendsofECCE/ECCE 的其他 Issue

查看 FriendsofECCE/ECCE 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。