Skip to content

Commit 3e46099

Browse files
committedJan 12, 2022
devop: cleanup
1 parent 9417729 commit 3e46099

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed
 

‎src/connectClient/WebRtcCommunication.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default class WebRtcCommunication extends MewConnectCommon {
2020
this.answersReceived = [];
2121
this.offersSent = -1;
2222
this.turnTimer = null;
23-
this.turnWaitTime = 5000;
23+
this.turnWaitTime = 2000;
2424
this.enableTimer = true;
2525
this.tryingTurn = false;
2626
this.connected = false;
@@ -162,7 +162,6 @@ export default class WebRtcCommunication extends MewConnectCommon {
162162
onConnect(peerID) {
163163
debug('onConnect', peerID);
164164
this.connected = true;
165-
// this.emit('connect', peerID);
166165
this.emit(this.jsonDetails.lifeCycle.RtcConnectedEvent, peerID);
167166
this.clearExtraOnConnection();
168167
}
@@ -240,7 +239,6 @@ export default class WebRtcCommunication extends MewConnectCommon {
240239
// Handle Socket Attempting Turn informative signal
241240
// Provide Notice that initial WebRTC connection failed and the fallback method will be used
242241
willAttemptTurn() {
243-
this.uiCommunicator(this.lifeCycle.UsingFallback, this.activeInitiatorId);
244242
if (!this.connected && this.tryingTurn && this.usingVersion === 'V2') {
245243
this.refreshQrTimer();
246244
this.refreshEnabled = false;
@@ -250,7 +248,6 @@ export default class WebRtcCommunication extends MewConnectCommon {
250248
debugStages(' TRY TURN V2');
251249
this.tryingTurn = true;
252250
try {
253-
console.log('here', 1);
254251
this.useFallback();
255252
} catch (e) {
256253
// eslint-disable-next-line
@@ -279,7 +276,6 @@ export default class WebRtcCommunication extends MewConnectCommon {
279276

280277
useFallback() {
281278
if (!this.connected) {
282-
console.log('here', 4);
283279
this.emit(this.lifeCycle.UsingFallback, this.activeInitiatorId);
284280
}
285281
}
@@ -311,7 +307,6 @@ export default class WebRtcCommunication extends MewConnectCommon {
311307
!this.turnDisabled
312308
) {
313309
this.turnDisabled = true;
314-
console.log('here', 2);
315310
this.useFallback();
316311
}
317312
}
@@ -419,7 +414,6 @@ export default class WebRtcCommunication extends MewConnectCommon {
419414
}
420415

421416
if (!this.connected && !this.tryingTurn && !this.turnDisabled) {
422-
console.log('here', 3);
423417
this.useFallback();
424418
} else {
425419
if (!this.isAlive()) {

‎src/connectClient/initiator/MewConnectInitiatorV2.js

-8
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,13 @@ export default class MewConnectInitiatorV2 extends MewConnectCommon {
5757
} catch (e) {
5858
debug('constructor error:', e);
5959
}
60-
6160
this.webRtcCommunication.on(this.lifeCycle.UsingFallback, id => {
6261
debug('USING TURN FALLBACK', id, this.initiatorId);
6362
if (this.initiatorId === id) {
64-
console.log('lifecycle fallback');
6563
this.useFallback();
6664
} else {
6765
this.socketDisconnect();
6866
this.isActiveInstance = false;
69-
// this.webRtcCommunication.off('data', this.onData.bind(this, ''));
7067
}
7168
});
7269
}
@@ -180,9 +177,7 @@ export default class MewConnectInitiatorV2 extends MewConnectCommon {
180177
}
181178

182179
async useFallback() {
183-
console.log('retry', this.retryCount);
184180
this.retryCount++;
185-
186181
if (this.retryCount >= 4) {
187182
this.emit('showRefresh');
188183
return;
@@ -378,15 +373,13 @@ export default class MewConnectInitiatorV2 extends MewConnectCommon {
378373
this.offersSent.push(data.sdp);
379374
// App was waiting for turn data and not sending back an answer
380375
this.offerTimer = setTimeout(() => {
381-
console.log('offer timeout');
382376
this.useFallback();
383377
}, 5000);
384378
debug('sendOffer', this.initiatorId);
385379
try {
386380
this.emit('sendingOffer');
387381
debug('SIGNAL', JSON.stringify(data));
388382
const encryptedSend = await this.mewCrypto.encrypt(JSON.stringify(data));
389-
// this.uiCommunicator(this.lifeCycle.sendOffer);
390383
this.states.offer = true;
391384
this.socketEmit(this.signals.offerSignal, {
392385
data: encryptedSend,
@@ -524,7 +517,6 @@ export default class MewConnectInitiatorV2 extends MewConnectCommon {
524517
debug(err.code);
525518
debug('error', err);
526519
if (!this.connected && !this.tryingTurn && !this.turnDisabled) {
527-
console.log('on error retyr');
528520
this.useFallback();
529521
} else if (!this.connected && this.tryingTurn && !this.turnDisabled) {
530522
this.emit('ShowReload');

0 commit comments

Comments
 (0)
Please sign in to comment.