threema-ch / threema-web

The Threema Web application.
GNU Affero General Public License v3.0
1k stars 107 forks source link

Delayed peer connection close behaviour #533

Closed lgrahl closed 6 years ago

lgrahl commented 6 years ago

If a WebRTC peer connection is being closed, the user will be thrown back to the welcome page. However, in the meantime, the WebSocket connection may already have been re-established. This results in the WebSocket connection getting closed again.

dbrgn commented 6 years ago

Here's the log:

[SaltyRTC.Client] New event: state-change saltyrtc-client.es5.js:2934:13
[SaltyRTC.Client] New event: state-change:closed saltyrtc-client.es5.js:2934:13
[StateService] Ignored signaling connection state to "closed" angular.js:14199:18
Secure data channel: Closed angular.js:14199:18
[VersionService] Checking for version update... angular.js:14199:18
Sending message request for contact YT8V3K5E with message id null angular.js:14199:18
Sending request/message message angular.js:14199:18
[VersionService] Checking for version update... angular.js:14199:18
[PeerConnectionHelper] ICE connection state change: disconnected angular.js:14199:18
[StateService] RTC connection state: connected => connecting angular.js:14199:18
[PeerConnectionHelper] ICE gathering state change: complete angular.js:14199:18
[PeerConnectionHelper] No more local ICE candidates angular.js:14199:18
[PeerConnectionHelper] ICE connection state change: failed angular.js:14199:18
[StateService] RTC connection state: connecting => disconnected angular.js:14199:18
[StatusController] Connection lost. Attempting to reconnect... angular.js:14199:18
[WebClientService] Disconnecting... angular.js:14199:18
[StateService] Reset angular.js:14199:18
[WebClientService] Closing secure datachannel angular.js:14199:18
[WebClientService] Closing signaling angular.js:14199:18
[SaltyRTC.Client] New event: state-change saltyrtc-client.es5.js:2934:13
[SaltyRTC.Client] New event: state-change:closing saltyrtc-client.es5.js:2934:13
[SaltyRTC.Initiator] Disconnecting WebSocket saltyrtc-client.es5.js:1150:17
[SaltyRTC.Initiator] Closing task connections saltyrtc-client.es5.js:1155:17
[SaltyRTC.WebRTC.initiator] Closing signaling data channel: Normal closing saltyrtc-task-webrtc.es5.js:901:13
[SaltyRTC.Client] New event: state-change saltyrtc-client.es5.js:2934:13
[SaltyRTC.Client] New event: state-change:closed saltyrtc-client.es5.js:2934:13
[WebClientService] Closing peer connection angular.js:14199:18
[StateService] Reset angular.js:14199:18
Starting WebClientService... angular.js:14199:18
[SaltyRTC.Client] New event: state-change saltyrtc-client.es5.js:2934:13
[SaltyRTC.Client] New event: state-change:new saltyrtc-client.es5.js:2934:13
[SaltyRTC.Client] New event: state-change saltyrtc-client.es5.js:2934:13
[SaltyRTC.Client] New event: state-change:ws-connecting saltyrtc-client.es5.js:2934:13
[SaltyRTC.Initiator] Opening WebSocket connection to wss://saltyrtc-08.threema.ch:443/0800cf36fe15228d9ae3054145baa738451c5bc736072f4bc0485cba3d769223 saltyrtc-client.es5.js:1172:13
[WebClientService] Peer connection was closed angular.js:14199:18
[StateService] Connection buildup state: connecting => closed angular.js:14199:18
[StateService] Signaling connection state: new => closing angular.js:14199:18
ICE failed, add a STUN server and see about:webrtc for more details
[StateService] Signaling connection state: closing => closed angular.js:14199:18
[PeerConnectionHelper] ICE connection state change: closed angular.js:14199:18
[PeerConnectionHelper] Signaling state change: closed angular.js:14199:18
[StateService] Connection buildup state: closed => connecting angular.js:14199:18
[StateService] Signaling connection state: closed => new angular.js:14199:18
[StateService] Signaling connection state: new => ws-connecting angular.js:14199:18
[SaltyRTC.Initiator] Opened connection saltyrtc-client.es5.js:984:13
[SaltyRTC.Client] New event: state-change saltyrtc-client.es5.js:2934:13
[SaltyRTC.Client] New event: state-change:server-handshake saltyrtc-client.es5.js:2934:13
[StateService] Signaling connection state: ws-connecting => server-handshake angular.js:14199:18
[SaltyRTC.Initiator] New ws message (81 bytes) saltyrtc-client.es5.js:1027:13
[SaltyRTC.Initiator] Received server-hello saltyrtc-client.es5.js:1189:21
[SaltyRTC.Initiator] Sending client-auth saltyrtc-client.es5.js:1273:13
Requested app wakeup angular.js:14199:18
[StateService] Connection buildup state: connecting => push angular.js:14199:18
[SaltyRTC.Initiator] New ws message (194 bytes) saltyrtc-client.es5.js:1027:13
[SaltyRTC.Initiator] Received server-auth saltyrtc-client.es5.js:1200:21
[SaltyRTC.Initiator] Expected server public permanent key is b1337fc8402f7db8ea639e05ed05d65463e24809792f91eca29e88101b4a2171 saltyrtc-client.es5.js:1435:13
[SaltyRTC.Initiator] Server public session key is 8fabf22c4b6b7963012423d641c688e706937dce940006ffbba81e47b05b5a50 saltyrtc-client.es5.js:1436:13
[SaltyRTC.Initiator] 0 responders connected saltyrtc-client.es5.js:1928:13
[SaltyRTC.Client] New event: state-change saltyrtc-client.es5.js:2934:13
[SaltyRTC.Client] New event: state-change:peer-handshake saltyrtc-client.es5.js:2934:13
[SaltyRTC.Initiator] Server handshake done saltyrtc-client.es5.js:1210:17
[StateService] Signaling connection state: server-handshake => peer-handshake angular.js:14199:18
[StatusController] Reconnect timeout 1. Retrying... angular.js:14199:18
[WebClientService] Disconnecting... angular.js:14199:18
[StateService] Reset angular.js:14199:18
[WebClientService] Closing secure datachannel angular.js:14199:18
[WebClientService] Closing signaling angular.js:14199:18
[SaltyRTC.Client] New event: state-change saltyrtc-client.es5.js:2934:13
[SaltyRTC.Client] New event: state-change:closing saltyrtc-client.es5.js:2934:13
[SaltyRTC.Initiator] Disconnecting WebSocket saltyrtc-client.es5.js:1150:17
[SaltyRTC.Client] New event: state-change saltyrtc-client.es5.js:2934:13
[SaltyRTC.Client] New event: state-change:closed saltyrtc-client.es5.js:2934:13
[WebClientService] Closing peer connection angular.js:14199:18
[StateService] Reset angular.js:14199:18
Starting WebClientService... angular.js:14199:18
dbrgn commented 6 years ago

Fixed by #551.