Log failure-notification timing and plan faster Windows toasts.

Append app-side delays to logs/notify-timing.log, add a PowerShell baseline
script (~773 ms), and track native WinRT toasts in ROADMAP.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-05 23:15:44 +03:00
parent 0aab9d8db6
commit 1e3d14bef2
6 changed files with 210 additions and 3 deletions
+19 -3
View File
@@ -13,6 +13,8 @@ import (
"fyne.io/fyne/v2/theme"
)
const runRecordTimeLayout = "2006-01-02 15:04:05"
// The UI package aliases domain types to keep widget callbacks short. The actual
// durable model still lives in src/domain, so UI code does not define a second
// copy of the scheduler data.
@@ -73,9 +75,23 @@ func newMainView(w fyne.Window, svc *app.Service) (fyne.CanvasObject, func(time.
if r.State == "Failed" &&
(r.Trigger == "Manual" || r.Trigger == "Schedule") &&
svc.ShouldNotifyOnFailure() {
fyne.CurrentApp().SendNotification(&fyne.Notification{
Title: "GoSentry: Job Failed",
Content: r.JobName + ": " + r.Detail,
timing := notificationTiming{
JobName: r.JobName,
EmittedAt: time.Now(),
}
if finished, err := time.ParseInLocation(runRecordTimeLayout, r.Time, time.Local); err == nil {
timing.RunFinished = finished
}
fyne.Do(func() {
timing.UIQueuedAt = time.Now()
fyne.CurrentApp().SendNotification(&fyne.Notification{
Title: "GoSentry: Job Failed",
Content: r.JobName + ": " + r.Detail,
})
timing.AfterSendAt = time.Now()
if err := appendNotificationTimingLog(svc.Store().Paths.LogsDir, timing); err != nil {
fyne.LogError("Failed to write notification timing log", err)
}
})
}
}