Fix delivery worker counting unsalvageable HTTP errors as successes (#37235)

This commit is contained in:
Shlee 2026-01-13 20:49:36 +07:00 committed by GitHub
parent d5264b3722
commit 232b9e9cc6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -38,7 +38,7 @@ class ActivityPub::DeliveryWorker
if @inbox_url.present? if @inbox_url.present?
if @performed if @performed
failure_tracker.track_success! failure_tracker.track_success!
else elsif !@unsalvageable
failure_tracker.track_failure! failure_tracker.track_failure!
end end
end end
@ -62,9 +62,13 @@ class ActivityPub::DeliveryWorker
stoplight_wrapper.run do stoplight_wrapper.run do
request_pool.with(@host) do |http_client| request_pool.with(@host) do |http_client|
build_request(http_client).perform do |response| build_request(http_client).perform do |response|
raise Mastodon::UnexpectedResponseError, response unless response_successful?(response) || response_error_unsalvageable?(response) || unsalvageable_authorization_failure?(response) if response_successful?(response)
@performed = true
@performed = true elsif response_error_unsalvageable?(response) || unsalvageable_authorization_failure?(response)
@unsalvageable = true
else
raise Mastodon::UnexpectedResponseError, response
end
end end
end end
end end