Add disabled failure sample job for testing desktop notifications.

Seed Failure notification test in defaultJobs so new installs can verify
Settings notifications via Run now without scheduler spam.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-05 22:50:02 +03:00
parent 1240297cca
commit 0a50f3c66b
2 changed files with 24 additions and 2 deletions
+6
View File
@@ -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,
+18 -2
View File
@@ -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