Skip to content

Commit 38ad130

Browse files
committed
Fix using signaling settings while being refetched
When the external signaling server returns the error "token_expired" the signaling settings are fetched again. However, if there are further requests and "token_expired" is returned again the previous fetch is canceled and a new one started instead, which causes the settings to be temporary set to "null". Signed-off-by: Daniel Calviño Sánchez <[email protected]>
1 parent 56db69c commit 38ad130

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/utils/signaling.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,14 @@ Signaling.Standalone.prototype.connect = function() {
646646
}, 2000)
647647
}
648648

649+
if (!this.settings) {
650+
console.warn('Signaling settings not found when trying to connect, they might be being updated.' )
651+
652+
this.reconnect()
653+
654+
return
655+
}
656+
649657
console.debug('Connecting to ' + this.url + ' for ' + this.settings.token)
650658
this.callbacks = {}
651659
this.id = 1

0 commit comments

Comments
 (0)