Skip to content

Bug: Type 2 normal restoral conditions inverted — fires for un-triggered thresholds #746

@somethingwithproof

Description

@somethingwithproof

Summary

In thold_functions.php (lines 3443-3512), the type 2 restoral logic uses < instead of >=:

// Type 0 restoral (correct):
if ($thold_data['thold_warning_fail_count'] >= $warning_trigger ...) {
    // send restoral — only when warning was actually triggered
}

// Type 2 restoral (inverted):
if ($alertstat != 0 && $warning_failures < $warning_trigger ...) {
    // sends restoral when count is BELOW trigger (never alerted)
}

The < vs >= inversion causes restorals to fire for thresholds that were never triggered, and silently suppresses them for thresholds that were.

Fix

Change < to >= for both $warning_failures and $failures comparisons in the type 2 restoral block.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions