Possible post_edited Event Regression issue?

Discourse Bug Report: :post_edited Event Regression in latest-release

Affects: Discourse latest-release branch (release +122)
Status: Confirmed regression - reproducible
Date: January 15, 2026


Summary

The :post_edited DiscourseEvent stopped being published in recent latest-release builds. Post edits complete successfully and revisions are created, but the event that plugins depend on is never fired. This breaks all plugins using the post_created_edited automation trigger and any other plugins listening to :post_edited events.


Reproduction (Confirmed)

We confirmed this is a regression by testing on two identical Azure AKS environments:

Before Update (Working)

  • Version: v2026.1.0-latest (older build)
  • Behavior: :white_check_mark: :post_edited events fire correctly
  • Automation: :white_check_mark: Works automatically

After Update (Broken)

  • Version: latest-release +1221 hours ago, release +122
  • Behavior: :cross_mark: :post_edited events never fire
  • Automation: :cross_mark: Completely broken

Critical Finding: Both environments worked before update. Both broke after updating to latest-release +122. This definitively proves a regression was introduced.


Environment Details

  • Discourse Version: latest-release (release +122)
  • Rails Version: 8.0.4
  • Infrastructure: Azure Kubernetes Service (AKS)
  • Docker Image: discourse/base:2.0.20260109-0020
  • Deployment: Standard Discourse Docker installation

Test Procedure

Test 1: Event Listener (Proves Event Never Fires)

# In Rails console
File.open('/tmp/post_edited_test.log', 'w') { |f| f.write("Test started at #{Time.now}\n") }

DiscourseEvent.on(:post_edited) do |post, topic_changed, revisor|
  File.open('/tmp/post_edited_test.log', 'a') do |f|
    f.write("[#{Time.now}] :post_edited fired! Post #{post.id}\n")
  end
end

Then edit any post via web interface and check:

cat /tmp/post_edited_test.log

Result on latest-release +122: Only shows “Test started” - event never fires
Result on older build: Shows event entries with timestamps and post IDs

Test 2: Verify Revisions Are Created

post = Post.find(POST_ID)
puts "Post revisions: #{post.revisions.count}"
post.revisions.last(3).each { |rev| puts "  Revision #{rev.number}: #{rev.created_at}" }

Result: Revisions ARE created correctly with proper timestamps
Conclusion: Edits are processed successfully, but post_process_post isn’t being called or event isn’t being triggered

Test 3: Manual Event Trigger (Proves Event System Works)

post = Post.find(POST_ID)
DiscourseEvent.trigger(:post_edited, post, false, PostRevisor.new(post))

Result: Event handlers execute correctly
Conclusion: Event system works, but automatic triggering during edits is broken


Expected Behavior

When a post is edited via web interface:

  1. Edit saves successfully :white_check_mark:
  2. Post revision created :white_check_mark:
  3. PostRevisor#post_process_post is called :cross_mark:
  4. :post_edited event triggered :cross_mark:
  5. Event handlers execute :cross_mark:

Only steps 1-2 work. Steps 3-5 are broken.


Actual Behavior

Production logs show successful edit completion:

Started PUT "/posts/3631" for 88.97.179.124 at 2026-01-15 13:06:19 +0000
Processing by PostsController#update as JSON
Completed 200 OK in 676ms

No errors, no exceptions, but no :post_edited event published.

The event should be triggered in /var/www/discourse/lib/post_revisor.rb line 759:

def post_process_post
  @post.invalidate_oneboxes = true
  @post.trigger_post_process
  DiscourseEvent.trigger(:post_edited, @post, self.topic_changed?, self)
end

This method is called from line 341 but the event is not being fired.


Impact

Affected Official Features

  • Discourse Automation: post_created_edited trigger completely broken
  • Any automation workflows depending on post edits fail silently

Affected Plugins

All plugins listening to :post_edited events are broken:

  • discourse-automation - Official automation triggers
  • discourse-ai - AI moderation on edited posts
  • discourse-doc-categories - Documentation index updates
  • discourse-topic-voting - Vote reclaim workflows
  • Any custom plugins using post edit events

Regression Timeline

  1. Older build: v2026.1.0-latest - :post_edited events worked :white_check_mark:
  2. Updated to: latest-release (release +122) - :post_edited events broken :cross_mark:
  3. Confirmed on: Two separate production environments (both broke after update)

This definitively proves a regression was introduced in recent latest-release builds.


Workaround

Manual triggering via Rails console works:

automation = DiscourseAutomation::Automation.find(AUTOMATION_ID)
post = Post.find(POST_ID)
automation.trigger!({"post" => post})

This confirms the automation system itself works - only automatic event triggering is broken.


Configuration Notes

  • Settings verified: All editing-related settings are standard/default
  • Grace period: Tested with edits well outside grace period (no effect)
  • Plugins: 50 plugins installed (standard official plugins)
  • No core modifications: Clean Discourse installation
  • Environment: Both test environments are identical Azure AKS deployments

Key Evidence

Most Important Finding:

We had a working DEV environment on an older build. After updating to latest-release +122, the automation stopped working. This proves with certainty that a regression was introduced in recent releases.

Both environments now exhibit identical broken behavior after being on the same version.


Reproducibility

100% reproducible - tested on two independent environments:

  1. Install Discourse latest-release (release +122)
  2. Create automation with post_created_edited trigger
  3. Edit a post
  4. Observe automation never triggers
  5. Confirm :post_edited event never fires using test listener

Summary

This is a confirmed regression in latest-release (release +122). The :post_edited event worked in previous versions and stopped working after updating. Two independent environments confirmed the same behavior. This breaks core Discourse Automation functionality and all plugins depending on post edit events.

1 Like