Skip to content

fix(ui): save recipes that have warnings - #244

Merged
mrcsin merged 1 commit into
masterfrom
save-with-warnings
Nov 30, 2026
Merged

mrcsin merged 1 commit into
masterfrom
save-with-warnings

Conversation

@mrcsin

@mrcsin mrcsin commented Nov 30, 2026

Copy link
Copy Markdown
Member

Problem

A recipe with any analysis warning could not be saved. RecipeCoordinator.SaveRecipeAsync rejected the save when RecipeSession.IsValid was false, and IsValid is false on any warning. A half-built loop, a loop start without its end or an end without its start, therefore blocked Save, so the exit, New and Open prompts in practice offered only "Не сохранять". The rejection text was also hard-coded English.

What changed

  • Save no longer checks validity. Warnings block only the write to the PLC, which keeps its own gate (PlcSyncCoordinator.NotifyRecipeChanged).
  • After fix(core): leave the session unchanged on a failed load #243 the session never holds a recipe whose analysis failed, so no save path can write an empty recipe over a file.
  • The English rejection message is removed.
  • docs/readme.md section 3.5 says a recipe with warnings can be saved.

This is Task 2 of docs/plans/20261130-recipe-replace-save-exit-safety.md.

Verification

  • Build 0 warnings; full suite 2205 passed, 0 failed; dotnet format --verify-no-changes clean.
  • New tests, failing on master: a recipe with an unclosed loop and one with a stray loop end save and reopen through the production Open path with the same warnings; the PLC sync service gets IsValid=false for such a recipe.
  • Five exit, New, Open and Save tests that needed a failing save now use a disk error and assert one error entry.
  • Code review and an independent review: no blocking findings.

🤖 Generated with Claude Code

RecipeCoordinator.SaveRecipeAsync rejected every recipe whose session
IsValid was false, and IsValid is false on any warning. A half-built
loop, a loop start without its end or an end without a start, blocked
Save, so the exit, New and Open prompts in practice offered only "Не
сохранять".

Save no longer checks validity. Since a failed load leaves the session
unchanged, the session always holds an analyzed recipe, so warnings
save and the file opens again with the same warnings. Writes to the
PLC keep their own gate on IsValid. The hard-coded English rejection
text goes with the old gate. The exit, New, Open and Save failure
tests used an unclosed loop to make the save fail; they now fail on a
real file system error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mrcsin
mrcsin marked this pull request as ready for review November 30, 2026 11:01
@mrcsin
mrcsin merged commit ec94162 into master Nov 30, 2026
1 check passed
@mrcsin
mrcsin deleted the save-with-warnings branch November 30, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant