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钩子保存,并且其状态保持不变。

由索引模型根据 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 摘要。