mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 12:19:41 +00:00
Don't reconnect if close was called
Fixes a bug during re-registration where we continue to re-open the socket using old credentials. // FREEBIE
This commit is contained in:
@@ -32,7 +32,7 @@ MessageReceiver.prototype = {
|
||||
this.pending = Promise.resolve();
|
||||
},
|
||||
close: function() {
|
||||
this.wsr.close();
|
||||
this.socket.close(3000, 'called close');
|
||||
delete this.listeners;
|
||||
},
|
||||
onopen: function() {
|
||||
@@ -42,8 +42,11 @@ MessageReceiver.prototype = {
|
||||
console.log('websocket error');
|
||||
},
|
||||
onclose: function(ev) {
|
||||
console.log('websocket closed', ev.code, ev.reason || '');
|
||||
if (ev.code === 3000) {
|
||||
return;
|
||||
}
|
||||
var eventTarget = this;
|
||||
console.log('websocket closed', ev.code);
|
||||
// possible 403 or network issue. Make an request to confirm
|
||||
this.server.getDevices(this.number).
|
||||
then(this.connect.bind(this)). // No HTTP error? Reconnect
|
||||
|
||||
Reference in New Issue
Block a user