# Possible post\_edited Event Regression issue?

**URL:** https://meta.discourse.org/t/possible-post-edited-event-regression-issue/393563
**Category:** Support
**Tags:** automation
**Created:** [January 15, 2026, 4:09pm UTC](https://meta.discourse.org/t/possible-post-edited-event-regression-issue/393563 "2026-01-15T16:09:51Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Neil\_Evans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil_evans/32/511055_2.png) [@Neil\_Evans](https://meta.discourse.org/u/Neil_Evans)
#### Post date: [January 15, 2026, 4:09pm UTC](https://meta.discourse.org/t/possible-post-edited-event-regression-issue/393563/1 "2026-01-15T16:09:51Z")

</div>

# 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:** ✅ `:post_edited` events fire correctly
- **Automation:** ✅ Works automatically

### After Update (Broken)

- **Version:** `latest-release +1221 hours ago, release +122`
- **Behavior:** ❌ `:post_edited` events never fire
- **Automation:** ❌ 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)

```ruby
# 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:

```bash
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

```ruby
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)

```ruby
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 ✅
2. Post revision created ✅
3. `PostRevisor#post_process_post` is called ❌
4. `:post_edited` event triggered ❌
5. Event handlers execute ❌

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

* * *

## Actual Behavior

Production logs show successful edit completion:

```plaintext
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:

```ruby
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 ✅
2. **Updated to:** `latest-release` (release +122) - `:post_edited` events broken ❌
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:

```ruby
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.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [January 16, 2026, 6:54pm UTC](https://meta.discourse.org/t/possible-post-edited-event-regression-issue/393563/3 "2026-01-16T18:54:43Z")

</div>

> [@Neil\_Evans](#):
>
> ```ruby
> # In Rails console
> 
> ```
> 
> […]
> 
> Then edit any post via web interface and check:

That’s **not** how `DiscourseEvent` works - it’s not inter-process but intra-process. So the events are only captured by listeners in the same process as the one that triggered it.

In the case of the discourse automation, I just tested it locally with the following settings

 ![2026-01-16 @ 18.53.31](https://global.discourse-cdn.com/meta/original/4X/c/c/2/cc28e9dd2780a325d864244a7774869a301fe80c.png)

and edited a post and it successfully sent the chat message

 ![2026-01-16 @ 18.54.16](https://global.discourse-cdn.com/meta/original/4X/b/9/3/b937bdcace340a682ee966a21bb314976d7e021f.png)

---

<div class="post-metadata">

### Author: ![Neil\_Evans2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil_evans2/32/492791_2.png) [@Neil\_Evans2](https://meta.discourse.org/u/Neil_Evans2)
#### Post date: [January 16, 2026, 7:36pm UTC](https://meta.discourse.org/t/possible-post-edited-event-regression-issue/393563/5 "2026-01-16T19:36:22Z")

</div>

Thanks! I will revisit this as clearly I have misunderstood. Hopefully I can get my plugin working with this information. Much appreciated,

---

<div class="post-metadata">

### Author: ![Neil\_Evans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil_evans/32/511055_2.png) [@Neil\_Evans](https://meta.discourse.org/u/Neil_Evans)
#### Post date: [January 16, 2026, 8:10pm UTC](https://meta.discourse.org/t/possible-post-edited-event-regression-issue/393563/6 "2026-01-16T20:10:07Z")

</div>

Thanks @zogstrip - we also tested by watching production logs while editing via the web interface:

**Test procedure:**

1. Cleared automation cooldown via console
2. Watched logs: `tail -f /var/www/discourse/log/production.log | grep "PDF Automation"`
3. Edited a post via web browser (same process as automation)
4. **Result:** Edit completes successfully (200 OK), but automation never triggers

We have two identical environments (DEV and PROD on Azure AKS):

- **Before update:** DEV automation worked perfectly (log file entries appear)
- **After updating to `latest-release` (+122):** Both DEV and PROD automations stopped working
- **Tested via web interface:** Still no automation triggers

Our automation configuration:

- Trigger: `post_created_edited`
- Script: Custom scriptable (`run_pdf_generation`)
- Filter: Category ID 34, tag “hd96-24”

Could there be something specific about custom scriptables or our environment that’s preventing the automation from triggering? The fact it worked before the update suggests something changed in how `post_created_edited` triggers fire.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [January 16, 2026, 8:16pm UTC](https://meta.discourse.org/t/possible-post-edited-event-regression-issue/393563/7 "2026-01-16T20:16:42Z")

</div>

Could you try with a “simpler” automation that uses the same trigger? Anything potentially related in /logs?

---

<div class="post-metadata">

### Author: ![Neil\_Evans2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil_evans2/32/492791_2.png) [@Neil\_Evans2](https://meta.discourse.org/u/Neil_Evans2)
#### Post date: [January 16, 2026, 8:45pm UTC](https://meta.discourse.org/t/possible-post-edited-event-regression-issue/393563/8 "2026-01-16T20:45:13Z")

</div>

Good idea - I’ll create a bare bones example to reproduce the problem and send it I over on Monday. Have a good weekend 🙂

---

<div class="post-metadata">

### Author: ![Neil\_Evans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil_evans/32/511055_2.png) [@Neil\_Evans](https://meta.discourse.org/u/Neil_Evans)
#### Post date: [January 17, 2026, 5:56pm UTC](https://meta.discourse.org/t/possible-post-edited-event-regression-issue/393563/9 "2026-01-17T17:56:01Z")

</div>

You were absolutely right about the inter-process issue with DiscourseEvent - thank you for that clarification!

After your feedback, we tested properly with a simple `send_chat_message` automation using the same `post_created_edited` trigger. When we edited a post, **the automation DID trigger** (we saw it processing in the logs and got a 500 error due to misconfiguration of the chat settings, not the trigger itself).

This confirms: **The `post_created_edited` trigger works correctly.**

Our confusion came from:

1. Testing with a Rails console listener (wrong - inter-process)
2. Our custom PDF scriptable was lost during a rebuild and we were having trouble re-registering it persistently

The trigger mechanism itself is functioning as expected. Sorry for the confusion and thank you for the help!

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [January 17, 2026, 5:58pm UTC](https://meta.discourse.org/t/possible-post-edited-event-regression-issue/393563/10 "2026-01-17T17:58:14Z")

</div>

Glad everything’s working as expected 👍

Now the _hard_ part, root causing why your custom `run_pdf_generation` script isn’t working anymore 😅
