but the devil is in the details of how your subscriptions and broadcasts are done.
Yup, devil was in the detail ![]()
I subscribed to topic outside “join” callback (I have send() for :after_join)
It now requires me to implement handle_out, which I did and push is working ![]()
Is handle_out normal for this sort of thing?
Current code (it’s currently WIP, so don’t judge haha)
I had subscribe in handle_info prior to this
def join("live-chat:room:" <> guest_id, %{"platformId" => platform_id}, socket) do
GuestChat.subscribe("live-chat:room:" <> guest_id)
send(self(), {:join_room, platform_id, guest_id})
{:ok, socket |> assign(:guest_id, guest_id)}
end
def handle_info({:join_room, platform_id, guest_id}, socket) do
GuestChat.broadcast("live-chat:room:" <> guest_id, "new_guest", %{uid: guest_id})
Presence.track(socket, "live-chat:room:" <> guest_id, %{guest_id: guest_id, platform_id: platform_id})
{:noreply, socket}
end






















