Not getting pub_sub notification

Trying pub_sub the first time using Ash, so I could be missing something very simple. The console shows a debug message like this, but the liveview handle_info isn't triggered. Do I need any other plumbing code than what's shown in the code excerpts below?
[debug] Broadcasting to topics ["items:update:bcb9b300-22b9-474e-8a8a-81473568e438"] via MyAppWeb.Endpoint.broadcast

Notification:

%Ash.Notifier.Notification{resource: ...
[debug] Broadcasting to topics ["items:update:bcb9b300-22b9-474e-8a8a-81473568e438"] via MyAppWeb.Endpoint.broadcast

Notification:

%Ash.Notifier.Notification{resource: ...
Here are the relevant codes currently in place. ``` <Liveview> @impl true def handle_info( %Phoenix.Socket.Broadcast{ topic: "items:update:" <> id }, socket ) do IO.inspect(id, "items:update id") ### This doesn't show up in the console. <Resource> pub_sub do module MyAppWeb.Endpoint prefix "items" broadcast_type :phoenix_broadcast publish :update, ["update", :id] end update :update do accept [ :name ] end ...
2 Replies
ZachDaniel
ZachDaniel3y ago
Have you subscribed to the corresponding channel?
Jason
JasonOP3y ago
That must be what I'm missing. Thank you!

Did you find this page helpful?