Quellcode durchsuchen

fix: Maybe start p2p only when we have received all presences.

There are cases where we start p2p on the first participant received presence, where there are more presences coming. This starts the process of p2p resulting and few iq errors while terminating it quickly after starting it.
On a normal joining as third participant we see around 38 send or received iq messages, in the problem scenario we see 60.
dev1
damencho vor 4 Jahren
Ursprung
Commit
9f65e8fab3
2 geänderte Dateien mit 18 neuen und 1 gelöschten Zeilen
  1. 16
    1
      JitsiConference.js
  2. 2
    0
      JitsiConferenceEventManager.js

+ 16
- 1
JitsiConference.js Datei anzeigen

@@ -1528,12 +1528,27 @@ JitsiConference.prototype.onMemberJoined = function(
1528 1528
 
1529 1529
     this._updateFeatures(participant);
1530 1530
 
1531
-    this._maybeStartOrStopP2P();
1531
+    // maybeStart only if we had finished joining as then we will have information for the number of participants
1532
+    if (this.isJoined()) {
1533
+        this._maybeStartOrStopP2P();
1534
+    }
1535
+
1532 1536
     this._maybeSetSITimeout();
1533 1537
 };
1534 1538
 
1535 1539
 /* eslint-enable max-params */
1536 1540
 
1541
+/**
1542
+ * Get notified when we joined the room.
1543
+ *
1544
+ * FIXME This should NOT be exposed!
1545
+ *
1546
+ * @private
1547
+ */
1548
+JitsiConference.prototype._onMucJoined = function() {
1549
+    this._maybeStartOrStopP2P();
1550
+};
1551
+
1537 1552
 /**
1538 1553
  * Updates features for a participant.
1539 1554
  * @param {JitsiParticipant} participant - The participant to query for features.

+ 2
- 0
JitsiConferenceEventManager.js Datei anzeigen

@@ -120,6 +120,8 @@ JitsiConferenceEventManager.prototype.setupChatRoomListeners = function() {
120 120
     // send some analytics events
121 121
     chatRoom.addListener(XMPPEvents.MUC_JOINED,
122 122
         () => {
123
+            this.conference._onMucJoined();
124
+
123 125
             this.conference.isJvbConnectionInterrupted = false;
124 126
 
125 127
             // TODO: Move all of the 'connectionTimes' logic to its own module.

Laden…
Abbrechen
Speichern