From 3e460993f022d2683c9c31894ad3d46be8ca2c3b Mon Sep 17 00:00:00 2001 From: Kosala Hemachandra <10602065+kvhnuke@users.noreply.github.com> Date: Tue, 11 Jan 2022 17:57:59 -0800 Subject: [PATCH] devop: cleanup --- src/connectClient/WebRtcCommunication.js | 8 +------- src/connectClient/initiator/MewConnectInitiatorV2.js | 8 -------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/connectClient/WebRtcCommunication.js b/src/connectClient/WebRtcCommunication.js index ab6b6a86..cece5a61 100644 --- a/src/connectClient/WebRtcCommunication.js +++ b/src/connectClient/WebRtcCommunication.js @@ -20,7 +20,7 @@ export default class WebRtcCommunication extends MewConnectCommon { this.answersReceived = []; this.offersSent = -1; this.turnTimer = null; - this.turnWaitTime = 5000; + this.turnWaitTime = 2000; this.enableTimer = true; this.tryingTurn = false; this.connected = false; @@ -162,7 +162,6 @@ export default class WebRtcCommunication extends MewConnectCommon { onConnect(peerID) { debug('onConnect', peerID); this.connected = true; - // this.emit('connect', peerID); this.emit(this.jsonDetails.lifeCycle.RtcConnectedEvent, peerID); this.clearExtraOnConnection(); } @@ -240,7 +239,6 @@ export default class WebRtcCommunication extends MewConnectCommon { // Handle Socket Attempting Turn informative signal // Provide Notice that initial WebRTC connection failed and the fallback method will be used willAttemptTurn() { - this.uiCommunicator(this.lifeCycle.UsingFallback, this.activeInitiatorId); if (!this.connected && this.tryingTurn && this.usingVersion === 'V2') { this.refreshQrTimer(); this.refreshEnabled = false; @@ -250,7 +248,6 @@ export default class WebRtcCommunication extends MewConnectCommon { debugStages(' TRY TURN V2'); this.tryingTurn = true; try { - console.log('here', 1); this.useFallback(); } catch (e) { // eslint-disable-next-line @@ -279,7 +276,6 @@ export default class WebRtcCommunication extends MewConnectCommon { useFallback() { if (!this.connected) { - console.log('here', 4); this.emit(this.lifeCycle.UsingFallback, this.activeInitiatorId); } } @@ -311,7 +307,6 @@ export default class WebRtcCommunication extends MewConnectCommon { !this.turnDisabled ) { this.turnDisabled = true; - console.log('here', 2); this.useFallback(); } } @@ -419,7 +414,6 @@ export default class WebRtcCommunication extends MewConnectCommon { } if (!this.connected && !this.tryingTurn && !this.turnDisabled) { - console.log('here', 3); this.useFallback(); } else { if (!this.isAlive()) { diff --git a/src/connectClient/initiator/MewConnectInitiatorV2.js b/src/connectClient/initiator/MewConnectInitiatorV2.js index def98632..b02ca6d3 100644 --- a/src/connectClient/initiator/MewConnectInitiatorV2.js +++ b/src/connectClient/initiator/MewConnectInitiatorV2.js @@ -57,16 +57,13 @@ export default class MewConnectInitiatorV2 extends MewConnectCommon { } catch (e) { debug('constructor error:', e); } - this.webRtcCommunication.on(this.lifeCycle.UsingFallback, id => { debug('USING TURN FALLBACK', id, this.initiatorId); if (this.initiatorId === id) { - console.log('lifecycle fallback'); this.useFallback(); } else { this.socketDisconnect(); this.isActiveInstance = false; - // this.webRtcCommunication.off('data', this.onData.bind(this, '')); } }); } @@ -180,9 +177,7 @@ export default class MewConnectInitiatorV2 extends MewConnectCommon { } async useFallback() { - console.log('retry', this.retryCount); this.retryCount++; - if (this.retryCount >= 4) { this.emit('showRefresh'); return; @@ -378,7 +373,6 @@ export default class MewConnectInitiatorV2 extends MewConnectCommon { this.offersSent.push(data.sdp); // App was waiting for turn data and not sending back an answer this.offerTimer = setTimeout(() => { - console.log('offer timeout'); this.useFallback(); }, 5000); debug('sendOffer', this.initiatorId); @@ -386,7 +380,6 @@ export default class MewConnectInitiatorV2 extends MewConnectCommon { this.emit('sendingOffer'); debug('SIGNAL', JSON.stringify(data)); const encryptedSend = await this.mewCrypto.encrypt(JSON.stringify(data)); - // this.uiCommunicator(this.lifeCycle.sendOffer); this.states.offer = true; this.socketEmit(this.signals.offerSignal, { data: encryptedSend, @@ -524,7 +517,6 @@ export default class MewConnectInitiatorV2 extends MewConnectCommon { debug(err.code); debug('error', err); if (!this.connected && !this.tryingTurn && !this.turnDisabled) { - console.log('on error retyr'); this.useFallback(); } else if (!this.connected && this.tryingTurn && !this.turnDisabled) { this.emit('ShowReload');