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?
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
Have you subscribed to the corresponding channel?
That must be what I'm missing. Thank you!