Liveview "view crashed" on infinite scroll live_render

This is my first attempt at liveview. I am converting a plug/cowboy websocket based dashboard that has 3 infinite scrolls on the page. In original dashboard the scrolls are updated by doing a prepend. In the liveview code that works as expected but is having one issue, that is I can see view crashed in browser log and the scroll other than the one receiving messages gets reset and it is rendered. So if danger is receving messages than success and warning will keep restting and any data in them will be lost. Here is what it looks like


I have my live view code organized as such
Screenshot from 2022-07-25 10-36-48
All of the streams have the same code. They are listening on the pubsub for events. Queue is stream and 3 event types danger warning success. There is code repetition as still learning liveview.

live_render is in the index.html.heex for the stream controller


each live_view component is the same as such.

Found the issue each of the LiveView get all messages as they listen to the same topic on pubsub so was crashing for the other message type changing the liveview code as such solves it

defmodule UltronexWeb.Stream.Danger.LiveView do
  use UltronexWeb, :live_view

  def mount(_params, _session, socket) do
    if connected?(socket), do: UltronexWeb.Endpoint.subscribe("stream")
    {:ok, init_stream(socket), temporary_assigns: [msg: []]}
  end

  def handle_info(%{event: "danger", payload: payload}, socket) do
    {:noreply, assign(socket, msg: payload)}
  end

  def handle_info(_event, socket) do
    {:noreply, assign(socket, msg: :empty)}
  end

  def init_stream(socket) do
    assign(socket, msg: Ultronex.Utility.Stream.template_msg_for_stream())
  end
end