Skip to content

Streamer crash fix

Alex Gleason requested to merge streamer-crash-fix into develop

There's a bug in StatusView that can cause the streamer to crash and disconnect in a very specific case:

[error] Ranch listener Pleroma.Web.Endpoint.HTTP had connection process started with :cowboy_clear:start_link/4 at #PID<0.1558.0> exit with reason: {{:badkey, :data, %{}}, [{Pleroma.Web.MastodonAPI.StatusView, :reblogged?, 2, [file: 'lib/pleroma/web/mastodon_api/views/status_view.ex', line: 72]}, {Pleroma.Web.MastodonAPI.StatusView, :render, 2, [file: 'lib/pleroma/web/mastodon_api/views/status_view.ex', line: 177]}, {Pleroma.Web.PleromaAPI.GroupView, :render, 2, [file: 'lib/pleroma/web/pleroma_api/views/group_view.ex', line: 69]}, {Pleroma.Web.StreamerView, :render, 3, [file: 'lib/pleroma/web/views/streamer_view.ex', line: 45]}, {Pleroma.Web.MastodonAPI.WebsocketHandler, :websocket_info, 2, [file: 'lib/pleroma/web/mastodon_api/websocket_handler.ex', line: 87]}, {:cowboy_websocket, :handler_call, 6, [file: '/home/alex/Projects/pleroma/deps/cowboy/src/cowboy_websocket.erl', line: 528]}, {:proc_lib, :wake_up, 3, [file: 'proc_lib.erl', line: 236]}]}

It's due to this typo:

object = Object.normalize(activity, fetch: false) || %{}

Instead of || %{} it should fall back to || %Object{}. That fixed it, but I decided to rewrite it with pattern matching instead to make it more defensive.

No changelog entry because it's not user facing.

Edited by Alex Gleason

Merge request reports