Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ discourse_ai:
default: ""
json_schema: DiscourseAi::Sentiment::SentimentSiteSettingJsonSchema
ai_sentiment_backfill_maximum_posts_per_hour:
default: 250
default: 2500
min: 0
max: 10000
hidden: true
Expand Down
1 change: 0 additions & 1 deletion lib/sentiment/entry_point.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ def inject_into(plugin)
end
end

plugin.on(:post_created, &sentiment_analysis_cb)
plugin.on(:post_edited, &sentiment_analysis_cb)

plugin.add_to_serializer(:current_user, :can_see_sentiment_reports) do
Expand Down
22 changes: 0 additions & 22 deletions spec/lib/modules/sentiment/entry_point_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,6 @@
fab!(:user) { Fabricate(:user, refresh_auto_groups: true) }

describe "registering event callbacks" do
context "when creating a post" do
let(:creator) do
PostCreator.new(
user,
raw: "this is the new content for my topic",
title: "this is my new topic title",
)
end

it "queues a job on create if sentiment analysis is enabled" do
SiteSetting.ai_sentiment_enabled = true

expect { creator.create }.to change(Jobs::PostSentimentAnalysis.jobs, :size).by(1)
end

it "does nothing if sentiment analysis is disabled" do
SiteSetting.ai_sentiment_enabled = false

expect { creator.create }.not_to change(Jobs::PostSentimentAnalysis.jobs, :size)
end
end

context "when editing a post" do
fab!(:post) { Fabricate(:post, user: user) }
let(:revisor) { PostRevisor.new(post) }
Expand Down