Notification: Clear last notified state per user on flapping end as well

This commit is contained in:
Yonas Habteab 2025-03-12 14:18:19 +01:00
parent 89f12c2323
commit 86365a4e2b

View File

@ -257,15 +257,18 @@ void Notification::BeginExecuteNotification(NotificationType type, const CheckRe
<< "notifications of type '" << notificationTypeName
<< "' for notification object '" << notificationName << "'.";
if (type == NotificationRecovery) {
Checkable::Ptr checkable = GetCheckable();
// Clear the last notified problem state per user if we're sending a recovery notification or if we're sending a
// flapping end notification and the checkable is already in an OK state. This is necessary since we might have
// missed the recovery notification due to the flapping state.
if (IsRecoveryOrFlappingEndAndCheckableIsOK(checkable, cr, type)) {
auto states (GetLastNotifiedStatePerUser());
states->Clear();
OnLastNotifiedStatePerUserCleared(this, nullptr);
}
Checkable::Ptr checkable = GetCheckable();
if (!force) {
TimePeriod::Ptr tp = GetPeriod();