{"action":"created","issue":{"url":"https://api.github.com/repos/phoenixframework/phoenix/issues/1012","labels_url":"https://api.github.com/repos/phoenixframework/phoenix/issues/1012/labels{/name}","comments_url":"https://api.github.com/repos/phoenixframework/phoenix/issues/1012/comments","events_url":"https://api.github.com/repos/phoenixframework/phoenix/issues/1012/events","html_url":"https://github.com/phoenixframework/phoenix/issues/1012","id":93821281,"number":1012,"title":"\"phx_join\" gets to Channel","user":{"login":"houshuang","id":61575,"avatar_url":"https://avatars.githubusercontent.com/u/61575?v=3","gravatar_id":"","url":"https://api.github.com/users/houshuang","html_url":"https://github.com/houshuang","followers_url":"https://api.github.com/users/houshuang/followers","following_url":"https://api.github.com/users/houshuang/following{/other_user}","gists_url":"https://api.github.com/users/houshuang/gists{/gist_id}","starred_url":"https://api.github.com/users/houshuang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houshuang/subscriptions","organizations_url":"https://api.github.com/users/houshuang/orgs","repos_url":"https://api.github.com/users/houshuang/repos","events_url":"https://api.github.com/users/houshuang/events{/privacy}","received_events_url":"https://api.github.com/users/houshuang/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"chrismccord","id":576796,"avatar_url":"https://avatars.githubusercontent.com/u/576796?v=3","gravatar_id":"","url":"https://api.github.com/users/chrismccord","html_url":"https://github.com/chrismccord","followers_url":"https://api.github.com/users/chrismccord/followers","following_url":"https://api.github.com/users/chrismccord/following{/other_user}","gists_url":"https://api.github.com/users/chrismccord/gists{/gist_id}","starred_url":"https://api.github.com/users/chrismccord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrismccord/subscriptions","organizations_url":"https://api.github.com/users/chrismccord/orgs","repos_url":"https://api.github.com/users/chrismccord/repos","events_url":"https://api.github.com/users/chrismccord/events{/privacy}","received_events_url":"https://api.github.com/users/chrismccord/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/phoenixframework/phoenix/milestones/11","html_url":"https://github.com/phoenixframework/phoenix/milestones/v0.15","labels_url":"https://api.github.com/repos/phoenixframework/phoenix/milestones/11/labels","id":1211613,"number":11,"title":"v0.15","description":"","creator":{"login":"chrismccord","id":576796,"avatar_url":"https://avatars.githubusercontent.com/u/576796?v=3","gravatar_id":"","url":"https://api.github.com/users/chrismccord","html_url":"https://github.com/chrismccord","followers_url":"https://api.github.com/users/chrismccord/followers","following_url":"https://api.github.com/users/chrismccord/following{/other_user}","gists_url":"https://api.github.com/users/chrismccord/gists{/gist_id}","starred_url":"https://api.github.com/users/chrismccord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrismccord/subscriptions","organizations_url":"https://api.github.com/users/chrismccord/orgs","repos_url":"https://api.github.com/users/chrismccord/repos","events_url":"https://api.github.com/users/chrismccord/events{/privacy}","received_events_url":"https://api.github.com/users/chrismccord/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":6,"state":"open","created_at":"2015-07-16T17:45:29Z","updated_at":"2015-07-30T14:52:44Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-07-08T15:37:15Z","updated_at":"2015-07-30T14:53:13Z","closed_at":"2015-07-30T14:52:44Z","body":"I found this message in my production log\r\n\r\n```elixir\r\n^[[0m^[[31m2015-07-08 07:15:39.279 [error] GenServer #PID<0.15393.0> terminating\r\nLast message: %Phoenix.Socket.Message{event: \"phx_join\", payload: %{\"userid\" => 1663, \"usernick\" => \"Tihawah\"}, ref: \"\r\n29\", topic: \"rooms:35\"}\r\nState: %Phoenix.Socket{assigns: %{}, channel: Survey.RoomChannel, channel_pid: #PID<0.15393.0>, endpoint: Survey.Endpo\r\nint, joined: true, pubsub_server: Survey.PubSub, ref: nil, topic: \"rooms:35\", transport: Phoenix.Transports.WebSocket,\r\n transport_pid: #PID<0.15382.0>}\r\n** (exit) an exception was raised:\r\n    ** (FunctionClauseError) no function clause matching in Survey.RoomChannel.handle_in/3\r\n        (survey) web/channels/room_channel.ex:41: Survey.RoomChannel.handle_in(\"phx_join\", %{\"userid\" => 1663, \"userni\r\nck\" => \"Tihawah\"}, %Phoenix.Socket{assigns: %{}, channel: Survey.RoomChannel, channel_pid: #PID<0.15393.0>, endpoint:\r\nSurvey.Endpoint, joined: true, pubsub_server: Survey.PubSub, ref: \"29\", topic: \"rooms:35\", transport: Phoenix.Transpor\r\nts.WebSocket, transport_pid: #PID<0.15382.0>})\r\n        (phoenix) lib/phoenix/channel/server.ex:214: Phoenix.Channel.Server.handle_info/2\r\n        (stdlib) gen_server.erl:593: :gen_server.try_dispatch/4\r\n        (stdlib) gen_server.erl:659: :gen_server.handle_msg/5\r\n        (stdlib) proc_lib.erl:237: :proc_lib.init_p_do_apply/3\r\n```\r\n\r\nIt's peculiar, because everything else is working well - a bunch of people have been logging on and off and chatting for days, and I only got this one message. (Right afterwards in the log, Tihawah was able to connect to the room and begin chatting normally. I wasn't sure what phx_join was or how I should handle it, but looking (quickly) at the source, it seems like this is an event that should be caught in Transport, and which would lead to the Channel's room function to be called, and not end up in handle_in?\r\n\r\nThe relevant code is here if it's useful: https://github.com/houshuang/survey/blob/master/web/channels/room_channel.ex\r\n"},"comment":{"url":"https://api.github.com/repos/phoenixframework/phoenix/issues/comments/126357715","html_url":"https://github.com/phoenixframework/phoenix/issues/1012#issuecomment-126357715","issue_url":"https://api.github.com/repos/phoenixframework/phoenix/issues/1012","id":126357715,"user":{"login":"chrismccord","id":576796,"avatar_url":"https://avatars.githubusercontent.com/u/576796?v=3","gravatar_id":"","url":"https://api.github.com/users/chrismccord","html_url":"https://github.com/chrismccord","followers_url":"https://api.github.com/users/chrismccord/followers","following_url":"https://api.github.com/users/chrismccord/following{/other_user}","gists_url":"https://api.github.com/users/chrismccord/gists{/gist_id}","starred_url":"https://api.github.com/users/chrismccord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrismccord/subscriptions","organizations_url":"https://api.github.com/users/chrismccord/orgs","repos_url":"https://api.github.com/users/chrismccord/repos","events_url":"https://api.github.com/users/chrismccord/events{/privacy}","received_events_url":"https://api.github.com/users/chrismccord/received_events","type":"User","site_admin":false},"created_at":"2015-07-30T14:53:13Z","updated_at":"2015-07-30T14:53:13Z","body":"I was unable to recreate this, but I have added logging for these cases and the channel will ignore the duplicate join sent from the client."}}