Skip to content

Instantly share code, notes, and snippets.

@olivermt olivermt/channel.ex
Created Dec 5, 2018

Embed
What would you like to do?
def join("room:" <> room_id, _params, socket) do
#this prints
IO.inspect(room_id)
case RoomCtx.find(room_id) do
nil ->
#does not print
IO.inspect("not found")
Logger.debug("[channel:room] attempted to join nonexistent room #{room_id}")
{:error, :not_found}
room ->
#does not print
IO.inspect("found room")
room = Repo.preload(room, :subscriptions)
do_join(socket, room, is_subscribed?(room, socket))
end
|> post_join()
end
def find(id) when is_binary(id) do
#this prints just fine
IO.inspect("Getting id #{id}")
Repo.get(Room, id)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.