fix: editing an automation removes the end of its schedule (#32191)

An automation whose schedule stops after a number of runs or on a date lost that end the first time it was edited and saved, even when only the title changed, so it kept running forever. The Edit dialog showed such a schedule as a plain Daily, Weekly or Monthly one, and those options have no setting for an end, so saving wrote the schedule back without it. These schedules now open as Custom with the stored rule in its text field and are saved exactly as they were.

Fixes #32000
This commit is contained in:
Classic298 2026-10-10 18:04:29 +02:00 • committed by GitHub
parent 4c5520a01f
commit 045020ce73
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -126,7 +126,7 @@
if (k && v) parts[k] = v;
});
const freq = parts.FREQ || 'DAILY';
if (!['HOURLY', 'DAILY', 'WEEKLY', 'MONTHLY'].includes(freq)) {
if (!['HOURLY', 'DAILY', 'WEEKLY', 'MONTHLY'].includes(freq) || parts.COUNT || parts.UNTIL) {
frequency = 'CUSTOM';
prevFrequency = 'CUSTOM';
customRrule = s;