PurgeExpiredActivity job duplicates
Got some errors in log:
[error] Elixir.Pleroma.Web.MastodonAPI.NotificationView failed to render {Pleroma.Web.MastodonAPI.NotificationView, "show.json"}
** (Ecto.MultipleResultsError) expected at most one result but got 2 in query:
from j0 in Oban.Job,
where: j0.state == "scheduled",
where: j0.queue == "activity_expiration",
where: fragment("?->>'activity_id' = ?", j0.args, ^"9wRDxv6vE9WIpRKp8K")
(ecto 3.4.6) lib/ecto/repo/queryable.ex:115: Ecto.Repo.Queryable.one/3
(pleroma 2.2.50-771-g732cc0ce-develop) lib/pleroma/web/mastodon_api/views/status_view.ex:232: Pleroma.Web.MastodonAPI.StatusView.render/2
(pleroma 2.2.50-771-g732cc0ce-develop) lib/pleroma/web/mastodon_api/views/notification_view.ex:154: Pleroma.Web.MastodonAPI.NotificationView.put_status/4
(pleroma 2.2.50-771-g732cc0ce-develop) lib/pleroma/web/mastodon_api/views/notification_view.ex:6: Pleroma.Web.MastodonAPI.NotificationView.safe_render/3
(elixir 1.11.2) lib/enum.ex:1399: Enum."-map/2-lists^map/1-0-"/2
(elixir 1.11.2) lib/enum.ex:1399: Enum."-map/2-lists^map/1-0-"/2
(pleroma 2.2.50-771-g732cc0ce-develop) lib/pleroma/web/mastodon_api/views/notification_view.ex:6: Pleroma.Web.MastodonAPI.NotificationView.safe_render_many/4
(phoenix 1.5.6) lib/phoenix/view.ex:472: Phoenix.View.render_to_iodata/3
Seems there are some circumstances when a duplicate job can be inserted. unique
option to the job insert must fix this.