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:
@@ -4,6 +4,12 @@ All notable GoSentry changes are recorded in this file.
|
|||||||
|
|
||||||
## 1.0.1 - 2026-08-04
|
## 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.**
|
**Platform layer rationale is documented in ARCHITECTURE.md.**
|
||||||
|
|
||||||
- **`docs/ARCHITECTURE.md`** — new §Platform layer: why autostart, file manager,
|
- **`docs/ARCHITECTURE.md`** — new §Platform layer: why autostart, file manager,
|
||||||
|
|||||||
+18
-2
@@ -169,8 +169,9 @@ func loadOrCreateJobs(path string) ([]domain.Job, error) {
|
|||||||
if found {
|
if found {
|
||||||
return jobs, nil
|
return jobs, nil
|
||||||
}
|
}
|
||||||
// Seed harmless sample jobs so a new user can immediately see scheduled
|
// Seed sample jobs so a new user can immediately see scheduled and manual
|
||||||
// and manual execution without inventing a command.
|
// execution without inventing a command. The failure sample stays disabled
|
||||||
|
// so it does not spam notifications; Run now still works for testing.
|
||||||
jobs = defaultJobs()
|
jobs = defaultJobs()
|
||||||
normalizeJobs(jobs)
|
normalizeJobs(jobs)
|
||||||
return jobs, writeJSON(path, domain.JobsFile{Jobs: 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"),
|
Command: echoCommand("This paused sample should not run until enabled"),
|
||||||
Enabled: false,
|
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 {
|
func echoCommand(message string) string {
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
return "echo " + message
|
return "echo " + message
|
||||||
|
|||||||
Reference in New Issue
Block a user