fix(workers): snooze incoming jobs while a host is backed off

With 5 attempts and Oban's short retry delays, an incoming activity from
an unknown actor on a backed-off host was discarded without a request.
ReceiverWorker and SignatureRetryWorker now snooze for up to 2 hours.
Also lowercase backoff host keys and log backed-off user fetches at debug.
This commit is contained in:
Lain Soykaf 2026-10-31 14:35:58 +04:00
commit b29d9d0981
No known key found for this signature in database
8 changed files with 97 additions and 13 deletions

View file

@ -67,6 +67,15 @@ defmodule Pleroma.HTTP.BackoffTest do
assert_ttl_about(300)
end
test "treats host names case-insensitively" do
mock_response(429)
assert {:error, :ratelimit} = Backoff.get("https://RateLimited.Example.com/users/alice")
assert_received :request
assert {:error, :ratelimit} = Backoff.get(@url)
refute_received :request
end
test "only backs off from the host that answered" do
mock_response(429)
assert {:error, :ratelimit} = Backoff.get(@url)