A domain's queued tasks follow it: deleted, set to manual, or replaced #332

Merged
jcoffey-dev merged 2 commits from fix/327-domain-tasks into main 2026-11-09 07:04:32 +00:00
Owner

Fixes #327.

  • Deleting a domain removes its DKIM management, DNS management and certificate renewal tasks, instead of leaving them to fail.
  • Automatic to manual (DKIM, DNS or certificate management) removes the matching queued task in the same save.
  • Queuing a DKIM task removes the domain's queued one first, so manual then automatic leaves one, not two. This is the same rule a new renewal already follows (#290).
  • A task whose domain is gone, or no longer manages that part itself, now ends quietly (TaskResult::Ignored) instead of as Failed. Installs that already have stale tasks clear them on their next run.

clear_queued_renewals is now one case of clear_queued_domain_tasks (domain_check.rs). A task running at that moment is left alone, as before.

Tests: a new domain_tasks_follow_settings_test in tests/src/automation/dkim.rs checks manual (0 tasks), automatic again (1), a changed second save (1) and a deleted domain (0, and no DNS task).

Checked locally: cargo check -p jmap -p services -p tests --tests, cargo fmt --check, and the automation suite's DKIM part, which all passes. The ACME part can't run on this workstation yet: its firewall doesn't let the Pebble container reach the test listener. Unchanged main fails at the same line, and so does the DNS part, which needs ACME's certificates for its TLSA records. I'll rerun the whole suite once the rule is in.

Fixes #327. - **Deleting a domain** removes its DKIM management, DNS management and certificate renewal tasks, instead of leaving them to fail. - **Automatic to manual** (DKIM, DNS or certificate management) removes the matching queued task in the same save. - **Queuing a DKIM task** removes the domain's queued one first, so manual then automatic leaves one, not two. This is the same rule a new renewal already follows (#290). - **A task whose domain is gone, or no longer manages that part itself**, now ends quietly (`TaskResult::Ignored`) instead of as Failed. Installs that already have stale tasks clear them on their next run. `clear_queued_renewals` is now one case of `clear_queued_domain_tasks` (`domain_check.rs`). A task running at that moment is left alone, as before. Tests: a new `domain_tasks_follow_settings_test` in `tests/src/automation/dkim.rs` checks manual (0 tasks), automatic again (1), a changed second save (1) and a deleted domain (0, and no DNS task). Checked locally: `cargo check -p jmap -p services -p tests --tests`, `cargo fmt --check`, and the automation suite's DKIM part, which all passes. The ACME part can't run on this workstation yet: its firewall doesn't let the Pebble container reach the test listener. Unchanged main fails at the same line, and so does the DNS part, which needs ACME's certificates for its TLSA records. I'll rerun the whole suite once the rule is in.
jcoffey-dev added 1 commit 2026-11-09 06:33:23 +00:00
A domain's queued tasks follow it: deleted, set to manual, or replaced (#327)
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Failing after 8m55s
373d47e5bd
A domain's DKIM, DNS and certificate renewal tasks were left behind:

- Deleting the domain left them queued. When they ran they ended as
  Failed ("Domain not found"), and stayed in the task list.
- Setting DKIM key management to manual left the rotation task, which
  later failed with "not set to automatic".
- Setting it back to automatic queued a new DKIM task beside the old
  one, so the domain had two.

Now:

- Deleting a domain removes its DKIM management, DNS management and
  certificate renewal tasks.
- A save that turns DKIM, DNS or certificate management from automatic
  to manual removes the matching task.
- A save that queues a DKIM task removes the domain's queued one first,
  the way a new renewal already replaces the queued one (#290).
- A task whose domain is gone, or no longer manages that part itself,
  ends quietly instead of as Failed, so installs that already have
  stale tasks clear them on their next run.

clear_queued_renewals is now one case of clear_queued_domain_tasks. A
task that's running at that moment is left alone, as before.

The DKIM automation test checks that manual removes the task, automatic
again leaves one, a second save still leaves one, and deleting the
domain leaves none. Reported on the forum (t/232, posts 8 and 9).
Author
Owner

With the workstation firewall rule now in place, the whole automation suite passes locally on RocksDB (automation::automation_tests: ACME, DKIM including the new task lifecycle test, DNS and RFC 2136; 1 passed, 104 s).

With the workstation firewall rule now in place, the whole automation suite passes locally on RocksDB (`automation::automation_tests`: ACME, DKIM including the new task lifecycle test, DNS and RFC 2136; 1 passed, 104 s).
jcoffey-dev added 1 commit 2026-11-09 06:55:26 +00:00
Mark acme.rs and dkim.rs as modified for INBUXA (#327)
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 8m45s
c336b24073
jcoffey-dev merged commit 4ef32fabc6 into main 2026-11-09 07:04:32 +00:00
jcoffey-dev deleted branch fix/327-domain-tasks 2026-11-09 07:04:32 +00:00
Sign in to join this conversation.