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

This commit is contained in:
Saúl Ibarra Corretgé 2021-09-15 11:22:30 +02:00 committed by Saúl Ibarra Corretgé
parent 663752be2c
commit a8f281a43e
2 changed files with 14 additions and 3 deletions

View File

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

View File

@ -275,8 +275,14 @@ function _constructOptions(state) {
// redux store. // redux store.
const options = _.cloneDeep(state['features/base/config']); const options = _.cloneDeep(state['features/base/config']);
let { bosh } = options; let { bosh, websocket } = options;
const { websocket } = options;
// TESTING: Only enable WebSocket for some percentage of users.
if (websocket) {
if ((Math.random() * 100) >= (options?.testing?.mobileXmppWsThreshold ?? 0)) {
websocket = undefined;
}
}
// Normalize the BOSH URL. // Normalize the BOSH URL.
if (bosh && !websocket) { if (bosh && !websocket) {
@ -301,6 +307,8 @@ function _constructOptions(state) {
// WebSocket is preferred over BOSH. // WebSocket is preferred over BOSH.
const serviceUrl = websocket || bosh; const serviceUrl = websocket || bosh;
logger.log(`Using service URL ${serviceUrl}`);
// Append room to the URL's search. // Append room to the URL's search.
const { room } = state['features/base/conference']; const { room } = state['features/base/conference'];