Skip to content

Improve Remote Object Fetcher error handling, Oban

feld requested to merge remote-fetcher-fixes into develop

Pleroma.Object.Fetcher.fetch_object_from_id/2 errors are only processed by Oban as everything else just checks for an {:ok, object} result and considers it a failure. For some reason we put the error processing logic into the Fetcher module to return {:error, _} or {:cancel, _} tuples for Oban job error handling, but this obfuscation just made things worse.

The error matching logic has been moved out of the Fetcher module and into the RemoteFetcherWorker module so it's easier to reason about.

In the process I've fixed it so :not_found, :forbidden, and :content_type errors when fetching objects do not result in the job being retried.

Tests improved as we can test the job directly now.

Edited by feld

Merge request reports

Loading