mirror of
https://github.com/discourse/discourse.git
synced 2026-08-04 02:13:26 -05:00
FIX: Do not call :post_edited webhook twice when editing OP (#13112)
When editing the first post for the topic we do two AJAX requests to two separate controllers in this order: PUT /t/topic-name PUT /posts/2489523 This causes two post revisor calls, which end up triggering the :post_edited DiscourseEvent twice. This is then picked up and sent as a WebHook event twice. However we do not need to send a :post_edited webhook event if the first post is being edited and topic_changed is true from the :post_edited DiscourseEvent, because a second event will shortly come through for just the post. See https://meta.discourse.org/t/post-webhook-fires-two-times-on-post-edited-for-first-post-in-a-topic/162408 Continued on from https://github.com/discourse/discourse/pull/10590
This commit is contained in:
+1
-1
@@ -170,7 +170,7 @@ class PostRevisor
|
||||
|
||||
@validate_topic = true
|
||||
@validate_topic = @opts[:validate_topic] if @opts.has_key?(:validate_topic)
|
||||
@validate_topic = !@opts[:validate_topic] if @opts.has_key?(:skip_validations)
|
||||
@validate_topic = !@opts[:skip_validations] if @opts.has_key?(:skip_validations)
|
||||
|
||||
@skip_revision = false
|
||||
@skip_revision = @opts[:skip_revision] if @opts.has_key?(:skip_revision)
|
||||
|
||||
Reference in New Issue
Block a user