Fix joining room before being connected to the external signaling server
Joining a room, if there is no connection yet to the external signaling
server, is deferred until a connection is established. When that happens
"joinRoom" is automatically called again by the signaling code.
However, the deferred "joinRoom" returned a Promise that was never
resolved nor rejected. Due to this the code originally calling
"joinRoom" can be left hanging indefinitely. This happened when joining
the room as a guest, which caused the chat to never load.
Now the initial Promise is resolved when the deferred "joinRoom" is
finally performed (unless "joinRoom" has been called again in the
meantime with a different token, in which case it is rejected).
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Loading
Please register or sign in to comment