{"action":"opened","issue":{"url":"https://api.github.com/repos/phoenixframework/phoenix/issues/2447","repository_url":"https://api.github.com/repos/phoenixframework/phoenix","labels_url":"https://api.github.com/repos/phoenixframework/phoenix/issues/2447/labels{/name}","comments_url":"https://api.github.com/repos/phoenixframework/phoenix/issues/2447/comments","events_url":"https://api.github.com/repos/phoenixframework/phoenix/issues/2447/events","html_url":"https://github.com/phoenixframework/phoenix/issues/2447","id":250845035,"number":2447,"title":"ChannelTest: got warning of Endpoint.subscribe","user":{"login":"g-viet","id":28592133,"avatar_url":"https://avatars2.githubusercontent.com/u/28592133?v=4","gravatar_id":"","url":"https://api.github.com/users/g-viet","html_url":"https://github.com/g-viet","followers_url":"https://api.github.com/users/g-viet/followers","following_url":"https://api.github.com/users/g-viet/following{/other_user}","gists_url":"https://api.github.com/users/g-viet/gists{/gist_id}","starred_url":"https://api.github.com/users/g-viet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/g-viet/subscriptions","organizations_url":"https://api.github.com/users/g-viet/orgs","repos_url":"https://api.github.com/users/g-viet/repos","events_url":"https://api.github.com/users/g-viet/events{/privacy}","received_events_url":"https://api.github.com/users/g-viet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-17T06:48:23Z","updated_at":"2017-08-17T06:48:23Z","closed_at":null,"body":"### Environment\r\n\r\n* Phoenix version: phoenix 1.3.0\r\n* Phoenix PubSub: 1.0.8\r\n\r\n### Overview\r\nAfter I joined `room:lobby`, I try to subscribe all topic inside like `room:1, room:2, room:3`.\r\n```\r\ndef join(\"room:lobby\", params, socket) do\r\n  Enum.map(room_ids, fn(room_id) ->\r\n    :ok = Sample.Endpoint.subscribe(\"room:#{room_id}\")\r\n  end)\r\n{:ok, socket}\r\nend\r\n```\r\n\r\nThen, I wrote a test:\r\n```\r\ndefmodule SampleTest do\r\n  use Sample.ChannelCase\r\n\r\n  test \"subscribe\" do\r\n    {:ok, _, socket} = subscribe_and_join(socket(), SampleChannel, \"room:lobby\", %{})\r\n    assert length(Sample.Presence.list(socket)) == 1\r\n  end\r\nend\r\n```\r\n\r\n### Expected behavior\r\nTest succeed\r\n\r\n### Actual behavior\r\nI got this warning:\r\n```\r\n15:41:42.843 [warn] Phoenix.Channel.Server #PID<0.471.0> received unexpected message in handle_info/2: %Phoenix.Socket.Broadcast{event: \"presence_diff\", payload: %{joins: %{}, leaves: %{}, online_at: 1502952101327, phx_ref: \"h2oip2qv/gU=\"}]}}}, topic: \"room:lobby\"}\r\n```\r\n\r\nIf I remove this instruction `:ok = Sample.Endpoint.subscribe(\"room:#{room_id}\")`, that test succeeded.\r\nWhat happened with my subscribe instruction ? "}}
{"actor":{"display_login":"g-viet"}}