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

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
         // disabled by the below option.
45
         // disabled by the below option.
46
         // enableThumbnailReordering: true,
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
         // P2P test mode disables automatic switching to P2P when there are 2
51
         // P2P test mode disables automatic switching to P2P when there are 2
49
         // participants in the conference.
52
         // participants in the conference.
50
-        p2pTestMode: false
53
+        // p2pTestMode: false,
51
 
54
 
52
         // Enables the test specific features consumed by jitsi-meet-torture
55
         // Enables the test specific features consumed by jitsi-meet-torture
53
         // testMode: false
56
         // testMode: false

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

275
     // redux store.
275
     // redux store.
276
     const options = _.cloneDeep(state['features/base/config']);
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
     // Normalize the BOSH URL.
287
     // Normalize the BOSH URL.
282
     if (bosh && !websocket) {
288
     if (bosh && !websocket) {
301
     // WebSocket is preferred over BOSH.
307
     // WebSocket is preferred over BOSH.
302
     const serviceUrl = websocket || bosh;
308
     const serviceUrl = websocket || bosh;
303
 
309
 
310
+    logger.log(`Using service URL ${serviceUrl}`);
311
+
304
     // Append room to the URL's search.
312
     // Append room to the URL's search.
305
     const { room } = state['features/base/conference'];
313
     const { room } = state['features/base/conference'];
306
 
314
 

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