Skip to content

feat(notifications): split database backup toggle into success/failure#4287

Draft
Alfredao wants to merge 5 commits intoDokploy:canaryfrom
Alfredao:feat/backup-notifications-split
Draft

feat(notifications): split database backup toggle into success/failure#4287
Alfredao wants to merge 5 commits intoDokploy:canaryfrom
Alfredao:feat/backup-notifications-split

Conversation

@Alfredao
Copy link
Copy Markdown

@Alfredao Alfredao commented Apr 22, 2026

Summary

Splits the single databaseBackup toggle on the notification table into backupSuccess (default off) and backupFailure (default on), so users can get failure alerts without success noise. Also enriches the payload with cron schedule, S3 destination, and duration.

Closes #2427.

Changes

Migration 0166_backup_notification_split.sql:

  • Adds backupSuccess (default false) and backupFailure (default true).
  • Backfills both from the current databaseBackup value so existing channels preserve behavior.
  • Drops databaseBackup.

Schema + Zod: all 12 provider apiCreate/apiUpdate picks updated (including the hand-maintained apiUpdatePushover block). Notification service layer threads the two new booleans through every create/update.

Dispatcher: selects the right column based on type (error vs success). Payload extended with schedule, destination (bucket/prefix), durationMs. Error messages truncated to 500 chars centrally so every provider honors the cap.

Email template: new optional props rendered in the details card.

Runners: postgres / mysql / mariadb / mongo / libsql / compose capture duration and pass schedule + destination to both success and error call sites.

UI: Backup Success and Backup Failure switches replace the single Database Backup toggle. Zod base schema, form.reset blocks for all 12 providers, onSubmit destructure, and mutation payloads updated.

Tests: new apps/dokploy/test/utils/backup-notifications.test.ts covers toggle selection per type, empty-list no-dispatch, enriched discord payload, and 500-char error truncation across discord/slack/telegram. 5/5 pass locally.

Scope

Test plan

  • Unit tests pass locally.
  • Manual Discord webhook: failure-on/success-off, trigger postgres backup with bad S3 creds, expect alert. Flip, confirm opposite.
  • Migration runs cleanly on a live instance.

Drafted early — happy to adjust scope or split further if preferred.

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.

feat: notification types (success, failed) / rework

1 participant