mirror of
https://github.com/abhinavxd/libredesk.git
synced 2026-09-24 11:26:22 +00:00
aa0deedd48
An automation rule that listens on an event and then writes the same field re-fires its own event, so the rule matches again and loops forever. Status already returned early on a no-op write, but priority and user assignment did not, so those two could spin a worker doing a DB write per lap. Add the same unchanged-value guard to both. Suppression while the engine applies actions was a plain flag in a sync.Map, so with more than one worker on the same conversation the first one to finish deleted the key while the other was still applying actions. Make it a refcount so each worker releases only its own claim. The starts with operator is only implemented by the automation evaluator, not the SQL filter builder, so give automation text fields their own operator list instead of adding it to the shared one. Also switch the notify action to its own recipients field type, fix the snooze duration hint since the backend only takes Go duration units, trim and lowercase notify recipient entries, and treat a missing previous value as no match rather than an empty string.