So I’ve tried `“client_id:#{client_id}” with no luck.
I’ve done this and they are all the same:
@impl true
def handle_params(%{"client_id" => client_id}, _url, socket) do
Logger.debug(IEx.Info.info(client_id))
Logger.debug(IEx.Info.info("client_id"))
Logger.debug(IEx.Info.info("client_id:#{client_id}"))
if connected?(socket), do: SentrypeerEvents.subscribe(client_id)
e.g.:
[debug] [{"Data type", "BitString"}, {"Byte size", 32}, {"Description", "This is a string: a UTF-8 encoded binary. It's printed surrounded by\n\"double quotes\" because all UTF-8 encoded code points in it are printable.\n"}, {"Raw representation", "<<105, 90, 110, 83, 53, 102, 107, 120, 57, 71, 114, 80, 112, 102, 100, 122, 83, 117, 65, 119, 53, 73, 106, 67, 113, 110, 76, 81, 87, 49, 80, 48>>"}, {"Reference modules", "String, :binary"}]
[debug] [{"Data type", "BitString"}, {"Byte size", 9}, {"Description", "This is a string: a UTF-8 encoded binary. It's printed surrounded by\n\"double quotes\" because all UTF-8 encoded code points in it are printable.\n"}, {"Raw representation", "<<99, 108, 105, 101, 110, 116, 95, 105, 100>>"}, {"Reference modules", "String, :binary"}]
[debug] [{"Data type", "BitString"}, {"Byte size", 42}, {"Description", "This is a string: a UTF-8 encoded binary. It's printed surrounded by\n\"double quotes\" because all UTF-8 encoded code points in it are printable.\n"}, {"Raw representation", "<<99, 108, 105, 101, 110, 116, 95, 105, 100, 58, 105, 90, 110, 83, 53, 102, 107, 120, 57, 71, 114, 80, 112, 102, 100, 122, 83, 117, 65, 119, 53, 73, 106, 67, 113, 110, 76, 81, 87, 49, 80, 48>>"}, {"Reference modules", "String, :binary"}]
and added the same debug into the functions I’ve already shown:
def subscribe(client_id) do
Logger.debug(IEx.Info.info(client_id))
Logger.debug("Subscribing to topic 'client_id:#{client_id}'")
Phoenix.PubSub.subscribe(Sentrypeer.PubSub, "client_id:#{client_id}")
end
defp broadcast({:error, _reason} = error, _client_id), do: error
defp broadcast({:ok, phone_number}, client_id) do
Logger.debug(IEx.Info.info(client_id))
Phoenix.PubSub.broadcast(
Sentrypeer.PubSub,
"client_id:#{client_id}",
{phone_number, client_id}
)
{:ok, phone_number}
end
which gives:
[debug] [{"Data type", "BitString"}, {"Byte size", 32}, {"Description", "This is a string: a UTF-8 encoded binary. It's printed surrounded by\n\"double quotes\" because all UTF-8 encoded code points in it are printable.\n"}, {"Raw representation", "<<105, 90, 110, 83, 53, 102, 107, 120, 57, 71, 114, 80, 112, 102, 100, 122, 83, 117, 65, 119, 53, 73, 106, 67, 113, 110, 76, 81, 87, 49, 80, 48>>"}, {"Reference modules", "String, :binary"}]
[debug] [{"Data type", "BitString"}, {"Byte size", 32}, {"Description", "This is a string: a UTF-8 encoded binary. It's printed surrounded by\n\"double quotes\" because all UTF-8 encoded code points in it are printable.\n"}, {"Raw representation", "<<105, 90, 110, 83, 53, 102, 107, 120, 57, 71, 114, 80, 112, 102, 100, 122, 83, 117, 65, 119, 53, 73, 106, 67, 113, 110, 76, 81, 87, 49, 80, 48>>"}, {"Reference modules", "String, :binary"}]
so now I’m TOTALLY confused 
Thanks for reading!