icinga2/lib
Julian Brost 7d0a43f926 Use Checkable::GetStateBeforeSuppression() only where relevant
This fixes an issue where recovery notifications get lost if they happen
outside of a notification time period.

Not all calls to `Checkable::NotificationReasonApplies()` need
`GetStateBeforeSuppression()` to be checked. In fact, for one caller,
`FireSuppressedNotifications()` in
`lib/notification/notificationcomponent.cpp`, the state before suppression may
not even be initialized properly, so that the default value of OK is used which
can lead to incorrect return values. Note the difference between suppressions
happening on the level of the `Checkable` object level and the `Notification`
object level. Only the first sets the state before suppression in the
`Checkable` object, but so far, also the latter used that value incorrectly.

This commit moves the check of `GetStateBeforeSuppression()` from
`Checkable::NotificationReasonApplies()` to the one place where it's actually
relevant: `Checkable::FireSuppressedNotifications()`. This made the existing
call to `NotificationReasonApplies()` unneccessary as it would always return
true: the `type` argument is computed based on the current check result, so
there's no need to check it against the current check result.
2024-10-11 13:21:10 +02:00
..
base Type: Simplify sort by load dependencies algorithm 2024-09-20 16:18:12 +02:00
checker Explicitly stop started timers and wait for them 2023-04-14 14:52:04 +02:00
cli Merge pull request #7799 from Icinga/bugfix/file-end 2023-08-25 11:06:19 +02:00
compat Explicitly stop started timers and wait for them 2023-04-14 14:52:04 +02:00
config ConfigItem::CommitNewItems(): pre-sort types by their load dependencies once 2024-09-20 16:18:12 +02:00
db_ido Update object#config_hash after all relations queries 2024-05-22 13:39:30 +02:00
db_ido_mysql Explicitly stop started timers and wait for them 2023-04-14 14:52:04 +02:00
db_ido_pgsql Explicitly stop started timers and wait for them 2023-04-14 14:52:04 +02:00
icinga Use Checkable::GetStateBeforeSuppression() only where relevant 2024-10-11 13:21:10 +02:00
icingadb IcingaDB::TimestampToMilliseconds(): limit output to four year digits 2024-09-30 16:54:40 +02:00
livestatus Centralise default icinga.* and env.* macros 2023-02-17 15:33:36 +01:00
methods Don't use thread-local variable in coroutine & process final cr in global thread pool 2024-09-05 17:36:03 +02:00
mysql_shim IDO MySQL: explicitly use latin1 2022-03-31 15:04:45 +02:00
notification Explicitly stop started timers and wait for them 2023-04-14 14:52:04 +02:00
perfdata Add closing quotationmarks in Validator for influxdb writer config 2024-09-25 13:03:00 +02:00
pgsql_shim Replace Copyright header with a short version, part II 2019-02-25 15:09:36 +01:00
remote HttpServerConnection: Drop yet another superfluous CpuBoundWork usage 2024-09-05 15:10:14 +02:00
CMakeLists.txt Rename ICINGA2_WITH_REDIS to ICINGA2_WITH_ICINGADB 2019-11-02 14:00:24 +01:00