discourse/plugins/automation/spec/scripts
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
..
add_user_to_group_through_custom_field_spec.rb DEV: add shortcut fab!(:variable, :fabricator) to specs (#33577) 2025-07-11 11:16:34 -03:00
append_last_checked_by_spec.rb DEV: Convert some files to autoloading and various improvements (#26860) 2024-05-06 23:12:55 +03:00
append_last_edited_by_spec.rb DEV: Convert some files to autoloading and various improvements (#26860) 2024-05-06 23:12:55 +03:00
auto_responder_spec.rb DEV: add shortcut fab!(:variable, :fabricator) to specs (#33577) 2025-07-11 11:16:34 -03:00
auto_tag_topic_spec.rb 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
banner_topic_spec.rb DEV: Improve banner topic permissions for read-restricted and unlisted topics (#38556) 2026-03-16 11:45:07 -05:00
close_topic_spec.rb DEV: Convert some files to autoloading and various improvements (#26860) 2024-05-06 23:12:55 +03:00
email_on_flagged_post_spec.rb FEATURE: New automation for emailing specific users when a post is flagged (#36580) 2025-12-11 10:31:13 +08:00
flag_post_on_words_spec.rb DEV: Convert some files to autoloading and various improvements (#26860) 2024-05-06 23:12:55 +03:00
gift_exchange_spec.rb DEV: add shortcut fab!(:variable, :fabricator) to specs (#33577) 2025-07-11 11:16:34 -03:00
group_category_notification_default_spec.rb DEV: Convert some files to autoloading and various improvements (#26860) 2024-05-06 23:12:55 +03:00
pin_topic_spec.rb DEV: Convert some files to autoloading and various improvements (#26860) 2024-05-06 23:12:55 +03:00
post_spec.rb DEV: add shortcut fab!(:variable, :fabricator) to specs (#33577) 2025-07-11 11:16:34 -03:00
remove_upload_markup_from_deleted_posts_spec.rb FIX: do not remove uploads from posts that are still in review queue (#37372) 2026-01-29 17:00:33 +05:30
send_pms_spec.rb FEATURE: support target_user_ids for private messages (#37708) 2026-02-12 09:21:40 +11:00
set_topic_timer_spec.rb FIX: Prevent automation set_topic_timer from reopening closed topics (#39375) 2026-04-21 15:08:31 +02:00
suspend_user_by_email_spec.rb DEV: Convert some files to autoloading and various improvements (#26860) 2024-05-06 23:12:55 +03:00
topic_required_words_spec.rb DEV: Convert some files to autoloading and various improvements (#26860) 2024-05-06 23:12:55 +03:00
topic_spec.rb FEATURE: Track automation errors and improve logging (#36938) 2026-01-19 18:50:13 +01:00
user_global_notice_spec.rb DEV: add shortcut fab!(:variable, :fabricator) to specs (#33577) 2025-07-11 11:16:34 -03:00
user_group_membership_through_badge_spec.rb FEATURE: Track automation errors and improve logging (#36938) 2026-01-19 18:50:13 +01:00
zapier_webhook_spec.rb DEV: Don’t replace Rails logger in specs (#29721) 2024-11-13 08:47:39 +08:00