Преглед изворни кода

feat((rn,config) add a/b test flag to enable XMPP WebSockets on mobile

master
Saúl Ibarra Corretgé пре 3 година
родитељ
комит
a8f281a43e
2 измењених фајлова са 14 додато и 3 уклоњено
  1. 4
    1
      config.js
  2. 10
    2
      react/features/base/connection/actions.native.js

+ 4
- 1
config.js Прегледај датотеку

@@ -45,9 +45,12 @@ var config = {
45 45
         // disabled by the below option.
46 46
         // enableThumbnailReordering: true,
47 47
 
48
+        // Enables XMPP WebSocket (as opposed to BOSH) for the given amount of users.
49
+        // mobileXmppWsThreshold: 10 // enable XMPP WebSockets on mobile for 10% of the users
50
+
48 51
         // P2P test mode disables automatic switching to P2P when there are 2
49 52
         // participants in the conference.
50
-        p2pTestMode: false
53
+        // p2pTestMode: false,
51 54
 
52 55
         // Enables the test specific features consumed by jitsi-meet-torture
53 56
         // testMode: false

+ 10
- 2
react/features/base/connection/actions.native.js Прегледај датотеку

@@ -275,8 +275,14 @@ function _constructOptions(state) {
275 275
     // redux store.
276 276
     const options = _.cloneDeep(state['features/base/config']);
277 277
 
278
-    let { bosh } = options;
279
-    const { websocket } = options;
278
+    let { bosh, websocket } = options;
279
+
280
+    // TESTING: Only enable WebSocket for some percentage of users.
281
+    if (websocket) {
282
+        if ((Math.random() * 100) >= (options?.testing?.mobileXmppWsThreshold ?? 0)) {
283
+            websocket = undefined;
284
+        }
285
+    }
280 286
 
281 287
     // Normalize the BOSH URL.
282 288
     if (bosh && !websocket) {
@@ -301,6 +307,8 @@ function _constructOptions(state) {
301 307
     // WebSocket is preferred over BOSH.
302 308
     const serviceUrl = websocket || bosh;
303 309
 
310
+    logger.log(`Using service URL ${serviceUrl}`);
311
+
304 312
     // Append room to the URL's search.
305 313
     const { room } = state['features/base/conference'];
306 314
 

Loading…
Откажи
Сачувај