diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 9c20a63..5e0d7c8 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -4,6 +4,12 @@ All notable GoSentry changes are recorded in this file. ## 1.0.1 - 2026-08-04 +**Sample jobs include a disabled failure test for desktop notifications.** + +- **`storage.defaultJobs`** — new disabled example *Failure notification test* + (folder Examples). Run it manually to trigger a failed run and verify + Settings → Notifications without waiting on the scheduler. + **Platform layer rationale is documented in ARCHITECTURE.md.** - **`docs/ARCHITECTURE.md`** — new §Platform layer: why autostart, file manager, diff --git a/src/storage/store.go b/src/storage/store.go index 6502f2b..c73ce60 100644 --- a/src/storage/store.go +++ b/src/storage/store.go @@ -169,8 +169,9 @@ func loadOrCreateJobs(path string) ([]domain.Job, error) { if found { return jobs, nil } - // Seed harmless sample jobs so a new user can immediately see scheduled - // and manual execution without inventing a command. + // Seed sample jobs so a new user can immediately see scheduled and manual + // execution without inventing a command. The failure sample stays disabled + // so it does not spam notifications; Run now still works for testing. jobs = defaultJobs() normalizeJobs(jobs) return jobs, writeJSON(path, domain.JobsFile{Jobs: jobs}) @@ -270,9 +271,24 @@ func defaultJobs() []domain.Job { Command: echoCommand("This paused sample should not run until enabled"), Enabled: false, }, + { + ID: 4, + Name: "Failure notification test", + Folder: "Examples", + Schedule: "@every 1m", + Command: failCommand(), + Enabled: false, + }, } } +func failCommand() string { + if runtime.GOOS == "windows" { + return "exit /b 1" + } + return "exit 1" +} + func echoCommand(message string) string { if runtime.GOOS == "windows" { return "echo " + message