discourse/plugins/automation/spec
Régis Hanol d4103b8e96
FIX: Prevent automation set_topic_timer from reopening closed topics (#39375)
When the `set_topic_timer` automation script saves a `:close` or
`:silent_close` timer on a topic that is already closed,
`TopicTimer#after_save` treats that state mismatch as the "Open
Temporarily" UI intent and immediately reopens the topic as the system
user.

Example seen on meta: an automation configured to add a 3-day close
timer whenever the `fixed` tag is present and a bug post is edited was
inadvertently reopening already-closed bug topics. Editing such a topic
fired the automation, the `:close` timer was saved, and the topic was
reopened by `system` before a moderator noticed and re-closed it.

Guard `auto_close` and `auto_close_after_last_post` in the script with
an early `next` when `topic.closed?` so the automation no-ops on closed
topics rather than triggering the reopen side-effect.
2026-04-21 15:08:31 +02:00
..
fabricators FIX: ensures global notices are destroyed on post created (#28684) 2024-09-02 21:17:10 +02:00
integration DEV: add shortcut fab!(:variable, :fabricator) to specs (#33577) 2025-07-11 11:16:34 -03:00
jobs FEATURE: support target_user_ids for private messages (#37708) 2026-02-12 09:21:40 +11:00
lib DEV: Add automatically closed topics event trigger and adapt the automation plugin's auto tag_topic_script accordingly (#39235) 2026-04-14 14:50:36 -05:00
models DEV: Fix job serialization deprecation in d-automation (#39286) 2026-04-15 15:39:16 +02:00
requests FEATURE: Track automation errors and improve logging (#36938) 2026-01-19 18:50:13 +01:00
scripts FIX: Prevent automation set_topic_timer from reopening closed topics (#39375) 2026-04-21 15:08:31 +02:00
serializers DEV: Clean up state to prevent flaky tests (#27397) 2024-06-10 08:41:03 +08:00
services DEV: Refactor automation Update service per PR #36458 feedback (#36771) 2025-12-18 18:16:03 +01:00
system UX: let automation d-editor respect user's editor mode preference (#38622) 2026-04-09 14:49:51 -03:00
triggers DEV: fix a large amount of typos (#37428) 2026-02-02 16:31:58 +11:00
plugin_helper.rb DEV: Convert some files to autoloading and various improvements (#26860) 2024-05-06 23:12:55 +03:00