]> cat aescling's git repositories - mastodon.git/commitdiff
Retry ActivityPub inbox delivery on HTTP 401 and 408 errors (#10812)
authorThibG <thib@sitedethib.com>
Thu, 23 May 2019 13:00:30 +0000 (15:00 +0200)
committerEugen Rochko <eugen@zeonfederated.com>
Thu, 23 May 2019 13:00:30 +0000 (15:00 +0200)
HTTP 401 responses returned by Mastodon's inbox controller may
be temporary if, for instance, the requesting user's actor/key json
could not be retrieved in a timely fashion. This changes allow retries
instead of dropping the message entirely.

Also added HTTP 408 as that error is by nature temporary.

app/workers/activitypub/delivery_worker.rb

index f9c385ea3e20ab77f7a5ef4ebeaed47e4b497d23..5e4c391f0d79977ad2d9fb0887f2515345ef0692 100644 (file)
@@ -51,7 +51,7 @@ class ActivityPub::DeliveryWorker
   end
 
   def response_error_unsalvageable?(response)
-    (400...500).cover?(response.code) && response.code != 429
+    (400...500).cover?(response.code) && ![401, 408, 429].include?(response.code)
   end
 
   def failure_tracker