Problem
The action engine polls every 10 seconds. If a rule's condition stays true (e.g. a specific URL is open), the same rule can fire again immediately after the previous execution finishes. This leads to duplicate actions — sending the same email twice, adding the same CRM entry twice, etc.
What to build
A per-rule last fired timestamp + a configurable minimum gap (default: 5 minutes). The action engine should skip a rule if now - last_fired_at < cooldown.
Two settings:
- Global default cooldown (Settings tab slider, default 5 min)
- Per-rule override (optional — could be a future issue)
Acceptance criteria
Files to look at
src/main/db.ts — safeAddColumn(), Rule interface, schema migrations at bottom
src/main/actionEngine.ts — rule dispatch logic
- The column is already displayed in the rule card UI if present
Problem
The action engine polls every 10 seconds. If a rule's condition stays true (e.g. a specific URL is open), the same rule can fire again immediately after the previous execution finishes. This leads to duplicate actions — sending the same email twice, adding the same CRM entry twice, etc.
What to build
A per-rule last fired timestamp + a configurable minimum gap (default: 5 minutes). The action engine should skip a rule if
now - last_fired_at < cooldown.Two settings:
Acceptance criteria
rulestable has alast_fired_atTEXT column (ISO timestamp, nullable) — add viasafeAddColumn()last_fired_aton every successful firelast_fired_atis within the cooldown windowrule_cooldown_minutesin settings table)Files to look at
src/main/db.ts—safeAddColumn(),Ruleinterface, schema migrations at bottomsrc/main/actionEngine.ts— rule dispatch logic