feat(notifications): split database backup toggle into success/failure#4287
Draft
Alfredao wants to merge 5 commits intoDokploy:canaryfrom
Draft
feat(notifications): split database backup toggle into success/failure#4287Alfredao wants to merge 5 commits intoDokploy:canaryfrom
Alfredao wants to merge 5 commits intoDokploy:canaryfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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
Drafted early — happy to adjust scope or split further if preferred.