You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support nested RULE macros in RULE.msg and RULE.logdata with safe recursion handling #3735
Add rule-aware nested macro expansion when %{RULE.msg} or %{RULE.logdata} resolves a message or logdata string that itself contains %{RULE.*}.
This is a follow-up requested by @airween. It is separate from PR #3734, which fixes direct action expansion in Msg::evaluate() and LogData::evaluate().
Current behavior and rationale
As discussed in the linked review, RuleWithActions::msg() and RuleWithActions::logData() call their action's data() method without the current rule context. Nested %{RULE.*} fields therefore expand to empty values. For example, reading %{RULE.msg} for a message containing %{RULE.id} loses the nested rule ID.
Passing the rule context without recursion handling can cause unbounded recursion for self-references such as a message containing %{RULE.msg}. Cross-references between message and logdata also need defined behavior.
Required changes
Define the expected behavior for nested expansion and recursive references.
Propagate the current rule through RuleWithActions::msg() / RuleWithActions::logData() and Msg::data() / LogData::data().
Design recursion handling that terminates direct and indirect cycles without suppressing valid non-recursive expansion.
Keep evaluation safe when multiple transactions and threads use shared rule objects. Do not introduce unsynchronized mutable evaluation state on shared rules.
Activity