W0010: effect fires on every tick where condition is true
Generated from rellum-diagnostics/src/db.rs.
Explanation
Subscribing an effect to a Bool-typed graph node means the effect fires on every tick where that value is true and its inputs changed - not only when it first becomes true. This is level-triggered behavior. If you want edge-triggered behavior, track the previous value explicitly.
Common causes
- subscribing an alert or notification effect to a threshold comparison
- using
on exceededwhere exceeded is a Bool derivation
Canonical fixes
- track the previous value to detect the rising edge
Before:
alert! on exceeded => send!(...)
After:
was_exceeded ~ feedback(
on sensor => exceeded,
false
)
alert! on sensor =>
match was_exceeded
false => send!(...)
true => ()
Code example
alert! on exceeded => send!(...)