mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-11 18:33:53 +00:00
cdde054b14
Reviewing the branch turned up defects, several of them worse than the problems the original commits set out to solve. Destructive: deleting an automation removed its global triggers and only then discovered a rundown event also referenced it. The delete failed, the user cancelled, and their triggers were gone for good. The server reports trigger references before event ones, so this was reachable whenever both existed. Deleted triggers are now recreated when the delete is refused. Silently wrong: a template read the project from disk while writes are debounced by three seconds, so "make some automations, save them as a template" could produce a template without them. Verified by hand: an automation created milliseconds earlier now appears. The demo shipped half a pair. The danger warning set a stage message visible and nothing ever cleared it, so from the first event that hit its danger window the message covered the countdown for the rest of the session. The recipe library ships the clearing counterpart; the demo now does too, and the whole cycle is verified against a running server. Flood control undid itself. resetAutomationLogState ran on every onLoad, and roll mode loads at every event boundary, so the "logging suppressed" notice was re-emitted once per cue: exactly the flooding it exists to prevent. It also wiped the throttle for onLoad and onStop immediately before writing to it. Reset now happens on stop only, outside the early returns that made the first attempt at this a no-op. Trigger reconciliation diffed a mount-time selection against a live prop. Settings are polled, so a trigger created in another tab while the form was open would be deleted by a save that never saw it. It now diffs against the snapshot, and says which triggers a save will remove rather than removing several same-lifecycle triggers silently. Also: a rundowns template no longer carries a phantom empty rundown from makeNewProject; the partial-duplicate endpoint returns the name it actually used, since collisions get renamed; the template flow invalidates the project list rather than relying on a refetch on mount; the last-fired label drops to a one minute cadence instead of holding a 1Hz timer per automation forever; e2e cleanup moved to afterEach so a mid-test failure stops leaking state. The e2e spec has now been run against a real server, green on both the demo project and a blank one, leaving no residue. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LpbLJVVT26tzWkduck1M9H