Fix Idempotency-Key ignored when scheduling a post (#30084)

This commit is contained in:
Claire
2024-04-26 15:19:02 +02:00
parent a6089cdfca
commit 70c4d70dbe
2 changed files with 9 additions and 2 deletions

View File

@@ -137,7 +137,7 @@ class PostStatusService < BaseService
def idempotency_duplicate
if scheduled?
@account.schedule_statuses.find(@idempotency_duplicate)
@account.scheduled_statuses.find(@idempotency_duplicate)
else
@account.statuses.find(@idempotency_duplicate)
end
@@ -189,7 +189,7 @@ class PostStatusService < BaseService
end
def scheduled_options
@options.tap do |options_hash|
@options.dup.tap do |options_hash|
options_hash[:in_reply_to_id] = options_hash.delete(:thread)&.id
options_hash[:application_id] = options_hash.delete(:application)&.id
options_hash[:scheduled_at] = nil