RichMedia: Disable websockets backfill streaming in StatusView

This commit is contained in:
Phantasm 2026-05-20 20:18:47 +02:00
commit 5f55c9653c
No known key found for this signature in database
GPG key ID: 2669E588BCC634C8

View file

@ -28,7 +28,10 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
# This is a naive way to do this, just spawning a process per activity
# to fetch the preview. However it should be fine considering
# pagination is restricted to 40 activities at a time
# Force disable Websockets streaming for backfill jobs,
# otherwise old posts can show up on timelines.
defp fetch_rich_media_for_activities(activities, opts) do
opts = Map.put(opts, :stream, false)
Enum.each(activities, fn activity ->
Card.get_by_activity(activity, opts)
end)
@ -362,8 +365,10 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
summary = object.data["summary"] || ""
# Force disable Websockets streaming for backfill jobs which the below call will create,
# otherwise old posts can show up on timelines.
card =
case Card.get_by_activity(activity, opts) do
case Card.get_by_activity(activity, Map.put(opts, :stream, false)) do
%Card{} = result -> render("card.json", result)
_ -> nil
end