From 17eb1a7e668dbba6e79612395b99407e8e8de6b9 Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 21 Oct 2025 18:00:40 +0200 Subject: [PATCH] Fix scheduled quote posts being posted as non-quote posts (#36550) --- app/workers/publish_scheduled_status_worker.rb | 1 + spec/workers/publish_scheduled_status_worker_spec.rb | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/app/workers/publish_scheduled_status_worker.rb b/app/workers/publish_scheduled_status_worker.rb index bcf20b494..0e34aa779 100644 --- a/app/workers/publish_scheduled_status_worker.rb +++ b/app/workers/publish_scheduled_status_worker.rb @@ -23,6 +23,7 @@ class PublishScheduledStatusWorker options.tap do |options_hash| options_hash[:application] = Doorkeeper::Application.find(options_hash.delete(:application_id)) if options[:application_id] options_hash[:thread] = Status.find(options_hash.delete(:in_reply_to_id)) if options_hash[:in_reply_to_id] + options_hash[:quoted_status] = Status.find(options_hash.delete(:quoted_status_id)) if options_hash[:quoted_status_id] end end end diff --git a/spec/workers/publish_scheduled_status_worker_spec.rb b/spec/workers/publish_scheduled_status_worker_spec.rb index a91e66596..81480f7e5 100644 --- a/spec/workers/publish_scheduled_status_worker_spec.rb +++ b/spec/workers/publish_scheduled_status_worker_spec.rb @@ -13,8 +13,12 @@ RSpec.describe PublishScheduledStatusWorker do end context 'when the account is not disabled' do + let(:user) { Fabricate(:user) } + let(:scheduled_status) { Fabricate(:scheduled_status, account: user.account, params: { text: 'Hello world, future!', quoted_status_id: Fabricate(:status, account: user.account).id }) } + it 'creates a status and removes scheduled record' do expect(scheduled_status.account.statuses.first.text).to eq 'Hello world, future!' + expect(scheduled_status.account.statuses.first.quote).to_not be_nil expect(ScheduledStatus.find_by(id: scheduled_status.id)).to be_nil end