Skip to content

[Fix] Automation schedules revert after edits during save - #3701

Open
roomote-roomote[bot] wants to merge 1 commit into
developfrom
fix/automation-schedule-pending-1112
Open

roomote-roomote[bot] wants to merge 1 commit into
developfrom
fix/automation-schedule-pending-1112

Conversation

@roomote-roomote

@roomote-roomote roomote-roomote Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

​Opened on behalf of @daniel-lxs. Follow up by mentioning @roomote-roomote, in the web UI, or in Telegram.

Related issue

Internal built-in automation settings correctness work; no separate issue.

Why this PR exists

  • A maintainer explicitly invited this PR in the linked issue or discussion
  • I am a maintainer / this is internal Roomote work

What changed

Built-in schedule controls accepted a newer selection while an earlier Save was pending, then silently replaced it with the saved response. The schedule Edit action and frequency selector now pause during that automation's save, including an editor already open when saving starts. A failed save restores editing with the submitted draft intact.

This wires existing per-automation pending state into the schedule-only controls and adds an optional disabled prop to the shared summary action. Event-style enable switches using the same component honor the same pending boundary. Normal choices, separate automation drafts and the existing layout remain; destination and additional-rules editing are outside this narrow lock. Eight added/three replaced production lines across existing controls, docs and two deferred-save regressions; no new state machine, API, schema, dependency or option. The independent contextual-label work in #3652 is not adopted.

How it was tested

  • Current develop 73fc55cc7: actual Automations → Security Auditor → On-demand → Save, held by a real PostgreSQL row lock. Selecting Weekly while Saving is accepted, then the genuine response restores On-demand and removes the dirty footer. Database confirms On-demand.
  • Exact pushed head 19b4d7f157329969e11c53927c3e239cdcd753c8: same pending-save path disables schedule Edit; committed-head replay confirms the guard and actual On-demand persistence. Separate Code Quality draft remains editable/unsaved after that save. Mobile already-open Weekly selector disables while pending; a temporary PostgreSQL trigger causes a real save failure, Weekly remains editable, removing the cause and clicking actual Save persists Weekly. The capture patch byte-matches the committed diff after hooks.
  • 82 focused rendered/adjacent tests pass, including genuine deferred QueryClient mutations for collapsed/open-editor failure recovery; web fast types, Mintlify build/broken links/rendered preview and full normal hooks pass. Exact-head hosted full tests, app build, docs, security/static/deployment/upgrade/backup checks and automated review are clean, with zero review threads. Normal human-review/protection gates remain.
  • Real local dev-login, isolated disposable PostgreSQL/Redis, no task worker attached, no Run now or real messages. Row locks control timing; a temporary DB trigger causes failure and is removed before retry. No DOM/store/response mocks. Images were opened and independently checked; they establish layout/state, not timing, authorization, persistence, scheduler/model/delivery behavior, all themes/widths or software keyboards.

Screenshots

Actual isolated runtime: collapsed desktop schedule Edit and already-open mobile selector while Save is pending:
Desktop pending schedule save
Mobile pending schedule save

After controlled DB failure, the same Weekly draft and Save are available. After removing the cause and retrying, the footer is clean; persistence was checked separately in PostgreSQL. No error toast is claimed from these frames:
Mobile draft after failed save
Mobile recovered schedule

Related PRs

Checklist

  • The PR title follows the repo convention: [Fix], [Feat], [Improve], [Refactor], [Docs], or [Chore] followed by a user-facing description
  • This PR is small and scoped to one change
  • pnpm lint and pnpm check-types pass locally (normal broad fast equivalents passed)
  • I added tests or included a clear manual validation note above
  • I removed secrets, tokens, private keys, and customer data from code, logs, and screenshots
  • If this change should appear in the changelog, I ran pnpm changeset (bounded schedule-control fix)

@roomote-community

roomote-community Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

No code issues found. See session

Reviewed all five changed files, per-automation pending-state wiring, shared control compatibility, save/error handling, and the deferred-save regressions. Current-head CI: lint, types, docs, and app build passed; tests and JavaScript/TypeScript analysis are still running. Repository validation suites were not rerun locally.

Reviewed 19b4d7f

@roomote-roomote
roomote-roomote Bot marked this pull request as ready for review November 12, 2026 06:42
@roomote-roomote
roomote-roomote Bot marked this pull request as draft November 12, 2026 06:46
@roomote-roomote
roomote-roomote Bot marked this pull request as ready for review November 12, 2026 06:50

This branch has not been deployed

No deployments
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