R-1199: a box whose household never saved its notification choice pushes the default list its page shows at start, so the hub mails by it; unreleased
gates / gates (push) Successful in 1m37s

This commit is contained in:
2026-10-21 23:40:21 +02:00
parent 5776d54901
commit ba22f9b2d9
5 changed files with 88 additions and 1 deletions
+9
View File
@@ -676,6 +676,15 @@ func (p *NotificationPrefs) SyncOnStartup() bool {
return p != nil && (p.Email != "" || p.EmailCleared)
}
// NotificationPrefsSaved reports whether the household ever saved its notification choice on this box. A box that never
// did shows DefaultEnabledEvents ticked on its page (GetNotificationPrefs) — R-1199: the hub must then mail by that
// same list, so the start-up sync pushes it (main.go, prefsSyncAtStartup).
func (s *Settings) NotificationPrefsSaved() bool {
s.mu.RLock()
defer s.mu.RUnlock()
return s.Notifications != nil
}
// DefaultEnabledEvents are the events enabled by default for new customers.
var DefaultEnabledEvents = []string{
"backup_failed",