Closed conor-mac-aoidh closed 7 years ago
Oh thank you so much for fixing this @conor-mac-aoidh, now leaving the channel makes sense. You can merge this when ready, looks right to me 👍
@vic can you publish a new version? Thanks!
@conor-mac-aoidh done! 0.4.2
is on npm.
@vic I've been doing some more testing the result of which is that we should be using
leave
when a channel join error or socket error occurs.Without these lines, I have been getting some errors like:
To recreate this error, you can simply start & stop the phoenix server. In the console, you should see the above error. This is the state the channel is in when the error occurs (extract from the debugger):
Also, if the
leave
isn't executed, the client will continuously attempt to rejoin the channel - and keep failing if it is an auth problem.Additionally, when an error occurs, the channel queue must be cleared, otherwise, these queries will be re-executed again later.