From dcfc4701c27bf149e21951f1079522848aaac2a5 Mon Sep 17 00:00:00 2001 From: lilia Date: Tue, 11 Apr 2017 14:43:25 -0700 Subject: [PATCH] Tweak socket event logging --- js/libtextsecure.js | 6 ++++-- libtextsecure/account_manager.js | 5 ++++- libtextsecure/message_receiver.js | 1 - 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/js/libtextsecure.js b/js/libtextsecure.js index 00aa5a3dd70..8571aa28b4b 100644 --- a/js/libtextsecure.js +++ b/js/libtextsecure.js @@ -37958,11 +37958,14 @@ var TextSecureServer = (function() { return new Promise(function(resolve, reject) { var socket = getSocket(); socket.onclose = function(e) { - console.log('websocket closed', e.code); + console.log('provisioning socket closed', e.code); if (!gotProvisionEnvelope) { reject(new Error('websocket closed')); } }; + socket.onopen = function(e) { + console.log('provisioning socket open'); + }; var wsr = new WebSocketResource(socket, { keepalive: { path: '/v1/keepalive/provisioning' }, handleRequest: function(request) { @@ -38212,7 +38215,6 @@ MessageReceiver.prototype.extend({ if (this.socket && this.socket.readyState !== WebSocket.CLOSED) { this.socket.close(); } - console.log('opening websocket'); // initialize the socket and start listening for messages this.socket = this.server.getMessageSocket(); this.socket.onclose = this.onclose.bind(this); diff --git a/libtextsecure/account_manager.js b/libtextsecure/account_manager.js index d25a17be42e..14dab651580 100644 --- a/libtextsecure/account_manager.js +++ b/libtextsecure/account_manager.js @@ -50,11 +50,14 @@ return new Promise(function(resolve, reject) { var socket = getSocket(); socket.onclose = function(e) { - console.log('websocket closed', e.code); + console.log('provisioning socket closed', e.code); if (!gotProvisionEnvelope) { reject(new Error('websocket closed')); } }; + socket.onopen = function(e) { + console.log('provisioning socket open'); + }; var wsr = new WebSocketResource(socket, { keepalive: { path: '/v1/keepalive/provisioning' }, handleRequest: function(request) { diff --git a/libtextsecure/message_receiver.js b/libtextsecure/message_receiver.js index 092ad761471..7ed411130c5 100644 --- a/libtextsecure/message_receiver.js +++ b/libtextsecure/message_receiver.js @@ -21,7 +21,6 @@ MessageReceiver.prototype.extend({ if (this.socket && this.socket.readyState !== WebSocket.CLOSED) { this.socket.close(); } - console.log('opening websocket'); // initialize the socket and start listening for messages this.socket = this.server.getMessageSocket(); this.socket.onclose = this.onclose.bind(this);