From 27966c3c089ee4df478b658c1a51925fb7bba4a9 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Mon, 21 Mar 2022 17:06:35 +0100 Subject: [PATCH] IcingaDB#SendRemovedComment(): ignore ack comments like #SendAddedComment() Icinga DB doesn't expect comment history for ack comments. Before: 1. Acked checkable recovers 2. Icinga clears ack comments w/o setting removal time 3. Icinga DB gets neither removal time, nor expire time 4. Icinga DB falls back to NULL and violates NOT NULL constraint --- lib/icingadb/icingadb-objects.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/icingadb/icingadb-objects.cpp b/lib/icingadb/icingadb-objects.cpp index e2272a63d..98a04162f 100644 --- a/lib/icingadb/icingadb-objects.cpp +++ b/lib/icingadb/icingadb-objects.cpp @@ -2022,7 +2022,7 @@ void IcingaDB::SendAddedComment(const Comment::Ptr& comment) void IcingaDB::SendRemovedComment(const Comment::Ptr& comment) { - if (!GetActive()) { + if (comment->GetEntryType() != CommentUser || !GetActive()) { return; }