fix(alerts): evaluate fresh reports and order notification delivery (#1242)

* fix(alerts): evaluate fresh reports and make notification transitions reliable

* fix(alerts): identify equal-timestamp reports by sequence

* fix(alerts): preserve notification transition semantics

---------

Co-authored-by: naiba <hi@nai.ba>
This commit is contained in:
Krisandnaiba authored and GitHub committed 2026-10-02 00:31:32 +08:00
1 parent 1420dd450c
commit 8328047aa8
16 files changed
+2122 -372

No files matched your search

+6
View File
@@ -178,6 +178,9 @@ func validateRule(c *gin.Context, r *model.AlertRule) error {
if !rule.IsSupportedType() {
return singleton.Localizer.ErrorT("unsupported rule type")
}
if !rule.HasSafeThresholds() {
return singleton.Localizer.ErrorT("invalid rule thresholds")
}
switch rule.Cover {
case model.RuleCoverAll, model.RuleCoverIgnoreAll:
default:
@@ -192,6 +195,9 @@ func validateRule(c *gin.Context, r *model.AlertRule) error {
return singleton.Localizer.ErrorT("duration is too large")
}
} else {
if !rule.HasSafeCycleUnit() {
return singleton.Localizer.ErrorT("invalid cycle unit")
}
if rule.CycleInterval < 1 {
return singleton.Localizer.ErrorT("cycle_interval need to be at least 1")
}