mirror of
https://github.com/cpvalente/ontime.git
synced 2026-09-10 08:39:34 +00:00
1ea9765092
Review pointed out that reconciling triggers breaks if one of them is deleted by someone else first. The form deletes sequentially and the server rejected a delete for a trigger that was already gone, so the whole save failed — and failed again on every retry, because the trigger the form still wants removed can never be removed. Two operators with the settings panel open, or a project import that replaces the automation block, is enough to reach it. Fixing that in the form would have meant recognising "already gone" from an error message, since the refusal comes back as a 400 like any other. The server is the better place: deleteAutomation fifty lines below already returns early for an id it cannot find, for exactly this reason, so the two delete functions now agree with each other and with what DELETE is supposed to mean. Nothing depended on the throw — the controller was its only caller and no test covered it. Verified end to end: with the automation form open and its lifecycle unticked, another client deletes that trigger, and the save now completes and closes rather than failing with an error the user cannot clear. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AfDKsy6PE3Rbyt32Fg4YKf