Fix #752: Dead $suspend_notify guard in ALERT>WARNING path - #797
Open
bmfmancini wants to merge 2 commits into
Open
Fix #752: Dead $suspend_notify guard in ALERT>WARNING path#797bmfmancini wants to merge 2 commits into
bmfmancini wants to merge 2 commits into
Conversation
The Type 0 ALERT>WARNING elseif block (thold_functions.php) was only reached when was false from the prior warning block. Since is only set to true when && , the guard 'if (! && !)' was structurally dead code - was always false in this path. This adds an independent evaluation for the ALERT>WARNING path, matching the pattern used in all other notification blocks, so the suspend mechanism (reset_ack re-alert suppression) works correctly here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #752
Problem
In
thold_functions.php, the Type 0ALERT > WARNINGelseifblock is only reached when$notifywasfalsein the prior warning block. The$suspend_notifyvariable is only ever set totruewhen$notify && $ra(the reset_ack re-alert suppression condition). Since$notifyisfalsewhen thiselseifpath is entered,$suspend_notifyis alwaysfalsehere.This makes the guard
if (!$suspend_notify && !$maint_dev)at the top of the ALERT>WARNING notification block structurally dead code — the suspend mechanism can never suppress notifications on this path.Fix
Added an independent
$suspend_notifyevaluation for the ALERT>WARNING path, matching the pattern used in all other notification blocks (ALERT-only, WARNING-only, baseline, and time-based blocks). The$ravariable is already set earlier in the warning block and remains valid in theelseif, so the re-alert suppression now works correctly:Testing