FIX: don't send post edit notification when hidden tags are changed

FIX: don’t send post edit notification when hidden tags are changed

diff --git a/lib/post_revisor.rb b/lib/post_revisor.rb
index 9e8842f..a177d57 100644
--- a/lib/post_revisor.rb
+++ b/lib/post_revisor.rb
@@ -451,6 +451,7 @@ class PostRevisor
     return if @skip_revision
     # don't create an empty revision if something failed
     return unless successfully_saved_post_and_topic
+    return if only_hidden_tags_changed?
     @version_changed ? create_revision : update_revision
   end
 
diff --git a/spec/components/post_revisor_spec.rb b/spec/components/post_revisor_spec.rb
index 26ad1b7..e540ce9 100644
--- a/spec/components/post_revisor_spec.rb
+++ b/spec/components/post_revisor_spec.rb
@@ -763,6 +763,12 @@ describe PostRevisor do
                 expect(result).to eq(true)
               }.to_not change { topic.reload.bumped_at }
             end
+
+            it "doesn't create revision" do
+              expect {
+                subject.revise!(Fabricate(:admin), raw: post.raw, tags: topic.tags.map(&:name) + ['secret'])
+              }.to_not change { post.reload.revisions.size }
+            end
           end
 
         end

GitHub sha: e6843afa

1 Like