warning: a struct for Pleroma.Marker is expected on struct update:
%Pleroma.Marker{marker | user: user}
but got type:
dynamic()
where "marker" was given the type:
# type: dynamic()
# from: lib/pleroma/marker.ex
{:ok, marker}
when defining the variable "marker", you must also pattern match on "%Pleroma.Marker{}".
hint: given pattern matching is enough to catch typing errors, you may optionally convert the struct update into a map update. For example, instead of:
user = some_function()
%User{user | name: "John Doe"}
it is enough to write:
%User{} = user = some_function()
%{user | name: "John Doe"}
typing violation found at:
│
81 │ {:ok, marker} -> %__MODULE__{marker | user: user}
│ ~
│
└─ lib/pleroma/marker.ex:81:24: Pleroma.Marker.get_marker/2
Ranch listener wasn't being properly stopped when the Gopher GenServer
received a shutdown message due Restarter rebooting Pleroma to apply
ConfigDB configuration (originating from
Config.TransferTask.load_and_update_env/2) when ConfigDB is enabled.
Handle by trapping exits in the GenServer, which causes the terminate/2
function to be called and the Ranch listener to be stopped from there.
23:22:29.871 [error] GenServer Restarter.Pleroma terminating
** (MatchError) no match of right hand side value:
{:error,
{{:shutdown,
{:failed_to_start_child, Pleroma.Gopher.Server,
{{:badmatch, {:error, {:already_started, #PID<0.4801.0>}}},
[
{Pleroma.Gopher.Server, :init, 1,
[file: ~c"lib/pleroma/gopher/server.ex", line: 25]},
{:gen_server, :init_it, 2, [file: ~c"gen_server.erl", line: 2276]},
{:gen_server, :init_it, 6, [file: ~c"gen_server.erl", line: 2236]},
{:proc_lib, :init_p_do_apply, 3, [file: ~c"proc_lib.erl", line: 333]}
]}}}, {Pleroma.Application, :start, [:normal, []]}}}
(restarter 0.1.0) lib/pleroma.ex:104: Restarter.Pleroma.do_restart/1
(restarter 0.1.0) lib/pleroma.ex:96: Restarter.Pleroma.handle_cast/2
(stdlib 7.2) gen_server.erl:2460: :gen_server.try_handle_cast/3
(stdlib 7.2) gen_server.erl:2418: :gen_server.handle_msg/3
(stdlib 7.2) proc_lib.erl:333: :proc_lib.init_p_do_apply/3
Last message: {:"$gen_cast", {:after_boot, :dev}}
State: %{rebooted: false, need_reboot: false, after_boot: false}
Drop follow_redirect/force_redirect from the HTTP options used when warming MediaProxy, relying on Tesla middleware instead (Hackney redirect handling can crash behind CONNECT proxies).
Also add a regression assertion in the policy test and document the upstream Hackney issues in ReverseProxy redirect handling.
Also ensure we always pass an absolute URL to Hackney when parsing a redirect response
(cherry picked from commit 00ac6bce8d244eec7e2460358296619e5cacba6b)
Hackney 1.25.x has redirect handling issues behind CONNECT proxies and with pools.
Disable hackney-level redirects and rely on Tesla.Middleware.FollowRedirects instead.
Also default to with_body: true so redirects can be followed reliably.