JavaPhoenixChannels
JavaPhoenixChannels copied to clipboard
When try to connect again, channel would not push again
I tried to disconnect wifi connection, then, connecting again, the socket tried to connect successfully, however when try to push again on the channel I will get error on server as:
Ignoring unmatched topic "buses:1" in MyApp.Schools.SchoolSocket
If do not try to disconnect the wifi and keep the connection, the channel pushes normally and no error at server..
What we have done is to check if channel is not null, then leave it.
if (channel!= null)channel.leave();
channel= new channel ...etc
How to solve this? You can share ideas at elixirforum thread here: https://elixirforum.com/t/why-i-get-warn-ignoring-unmatched-topic/5184/11
Yeah, I have faced the same problem and the reason was that the Channel was in Error/Closed state when I push again. I decided to re-create a new channel instance and use it. Needed to leave original channel. There was some problem with closing the original channel properly. But did some tweak to the original code. Anyway, it's now resolved and working fine. Msg me for detailed answer.
@lucasleongit how did you resolve the issue ?. Why didnt you create a pull request