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

Open Beginner friendly
#1,138 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
c

Research direction

Read src/apps/builder/Builder.C around Builder::doSave() and compare its behavior with the read-only check used to disable File > Save. The issue also points to ChemistryTask::fragment() in src/dsm/edsiimpl/ChemistryTask.C, which changes the state to Created. Verify that a read-only calculation cannot be saved through the direct save hook and that its state remains unchanged.

Written by the indexing model from the issue text.

Description

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

Dominant language
C
Stars
10
Forks
8
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from FriendsofECCE/ECCE

All issues in FriendsofECCE/ECCE

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.