Skip to content

Add scheduled ntfy reminders for overdue restore tests #92

Description

@borg-codex-bot

Summary

Add a dedicated reminder mechanism for overdue scheduled restore tests. The current ntfy restore_test_overdue event is only emitted when a scheduled restore-test run starts and detects a due job. It does not act as an independent reminder if a job is overdue but no scheduled run has executed yet.

Current behavior

  • The UI can show restore tests as overdue.
  • ntfy does not poll independently.
  • restore_test_overdue is only sent during /api/restore-tests/run with scheduled=true.
  • Manual restore-test runs do not send overdue notifications.
  • If no restore-test cron/schedule runs, no ntfy reminder is sent for an overdue restore test.

Desired behavior

Introduce a background/scheduled overdue reminder check for restore tests:

  • Periodically evaluate scheduled restore-test policies.
  • Detect jobs whose restore test is overdue.
  • Send an ntfy notification for overdue scheduled restore tests, even when no restore test is being executed immediately.
  • Avoid notification spam by sending at most one reminder per job per overdue period or by using a configurable reminder interval.
  • Persist reminder state so service restarts do not cause duplicate notifications.
  • Keep manual runs silent unless explicitly intended.

Suggested implementation notes

  • Reuse the existing restore-test plan calculation where possible.
  • Add a small persisted state file for reminder delivery, for example under the runtime config/state directory.
  • Consider a cron-backed endpoint or a lightweight scheduler route similar to the existing restore-test schedule path.
  • Only notify for jobs with policy mode scheduled and is_overdue=true.
  • Reset or clear the reminder state after a successful restore test for that job.
  • Respect ntfy event selection and only send when restore_test_overdue is enabled.

Acceptance criteria

  • Overdue scheduled restore tests can trigger ntfy reminders without starting a restore test immediately.
  • A user does not receive repeated notifications on every poll for the same overdue period.
  • Reminder state survives UI/server restarts.
  • Successful restore tests clear the overdue reminder state for the affected job.
  • The behavior is documented in the UI/help or release notes.
  • Secrets are not logged.

User impact

Users with scheduled restore-test policies can be informed when a restore verification is overdue, instead of only seeing the overdue state in the UI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    impact::user-visibleVisible effect for plugin usersrelease-note::yesInclude in user-facing release notestype::featureNew user-facing or plugin feature

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions