feat: Drops external connect optimization. (#12958)

* feat: Drops external connect optimization.

A bosh only optimization which is no longer used and does not bring any significant value when measured.

* squash: Updates ljm.
This commit is contained in:
Дамян Минков 2023-02-24 01:59:00 -06:00 committed by GitHub
parent c641835d0f
commit 8225f5e363
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 12 additions and 174 deletions

View File

@ -44,8 +44,6 @@ deploy-appbundle:
cp \ cp \
$(BUILD_DIR)/app.bundle.min.js \ $(BUILD_DIR)/app.bundle.min.js \
$(BUILD_DIR)/app.bundle.min.js.map \ $(BUILD_DIR)/app.bundle.min.js.map \
$(BUILD_DIR)/do_external_connect.min.js \
$(BUILD_DIR)/do_external_connect.min.js.map \
$(BUILD_DIR)/external_api.min.js \ $(BUILD_DIR)/external_api.min.js \
$(BUILD_DIR)/external_api.min.js.map \ $(BUILD_DIR)/external_api.min.js.map \
$(BUILD_DIR)/alwaysontop.min.js \ $(BUILD_DIR)/alwaysontop.min.js \
@ -68,7 +66,6 @@ deploy-lib-jitsi-meet:
$(LIBJITSIMEET_DIR)/dist/umd/lib-jitsi-meet.min.js \ $(LIBJITSIMEET_DIR)/dist/umd/lib-jitsi-meet.min.js \
$(LIBJITSIMEET_DIR)/dist/umd/lib-jitsi-meet.min.map \ $(LIBJITSIMEET_DIR)/dist/umd/lib-jitsi-meet.min.map \
$(LIBJITSIMEET_DIR)/dist/umd/lib-jitsi-meet.e2ee-worker.js \ $(LIBJITSIMEET_DIR)/dist/umd/lib-jitsi-meet.e2ee-worker.js \
$(LIBJITSIMEET_DIR)/connection_optimization/external_connect.js \
$(LIBJITSIMEET_DIR)/modules/browser/capabilities.json \ $(LIBJITSIMEET_DIR)/modules/browser/capabilities.json \
$(DEPLOY_DIR) $(DEPLOY_DIR)
@ -129,7 +126,7 @@ dev: deploy-init deploy-css deploy-rnnoise-binary deploy-tflite deploy-meet-mode
source-package: source-package:
mkdir -p source_package/jitsi-meet/css && \ mkdir -p source_package/jitsi-meet/css && \
cp -r *.js *.html resources/*.txt connection_optimization favicon.ico fonts images libs static sounds LICENSE lang source_package/jitsi-meet && \ cp -r *.js *.html resources/*.txt favicon.ico fonts images libs static sounds LICENSE lang source_package/jitsi-meet && \
cp css/all.css source_package/jitsi-meet/css && \ cp css/all.css source_package/jitsi-meet/css && \
(cd source_package ; tar cjf ../jitsi-meet.tar.bz2 jitsi-meet) && \ (cd source_package ; tar cjf ../jitsi-meet.tar.bz2 jitsi-meet) && \
rm -rf source_package rm -rf source_package

11
app.js
View File

@ -33,17 +33,6 @@ window.APP = {
API, API,
conference, conference,
// Used by do_external_connect.js if we receive the attach data after
// connect was already executed. status property can be 'initialized',
// 'ready', or 'connecting'. We are interested in 'ready' status only which
// means that connect was executed but we have to wait for the attach data.
// In status 'ready' handler property will be set to a function that will
// finish the connect process when the attach data or error is received.
connect: {
handler: null,
status: 'initialized'
},
// Used for automated performance tests. // Used for automated performance tests.
connectionTimes: { connectionTimes: {
'index.loaded': window.indexLoadedTime 'index.loaded': window.indexLoadedTime

View File

@ -1372,7 +1372,6 @@ var config = {
dialOutRegionUrl dialOutRegionUrl
disableRemoteControl disableRemoteControl
displayJids displayJids
externalConnectUrl
e2eeLabels e2eeLabels
firefox_fake_device firefox_fake_device
googleApiApplicationClientID googleApiApplicationClientID

View File

@ -32,54 +32,6 @@ const logger = Logger.getLogger(__filename);
*/ */
export const DISCO_JIBRI_FEATURE = 'http://jitsi.org/protocol/jibri'; export const DISCO_JIBRI_FEATURE = 'http://jitsi.org/protocol/jibri';
/**
* Checks if we have data to use attach instead of connect. If we have the data
* executes attach otherwise check if we have to wait for the data. If we have
* to wait for the attach data we are setting handler to APP.connect.handler
* which is going to be called when the attach data is received otherwise
* executes connect.
*
* @param {string} [id] user id
* @param {string} [password] password
* @param {string} [roomName] the name of the conference.
*/
function checkForAttachParametersAndConnect(id, password, connection) {
if (window.XMPPAttachInfo) {
APP.connect.status = 'connecting';
// When connection optimization is not deployed or enabled the default
// value will be window.XMPPAttachInfo.status = "error"
// If the connection optimization is deployed and enabled and there is
// a failure the value will be window.XMPPAttachInfo.status = "error"
if (window.XMPPAttachInfo.status === 'error') {
connection.connect({
id,
password
});
return;
}
const attachOptions = window.XMPPAttachInfo.data;
if (attachOptions) {
connection.attach(attachOptions);
delete window.XMPPAttachInfo.data;
} else {
connection.connect({
id,
password
});
}
} else {
APP.connect.status = 'ready';
APP.connect.handler
= checkForAttachParametersAndConnect.bind(
null,
id, password, connection);
}
}
/** /**
* Try to open connection using provided credentials. * Try to open connection using provided credentials.
* @param {string} [id] * @param {string} [id]
@ -182,7 +134,10 @@ export async function connect(id, password) {
APP.store.dispatch(setPrejoinDisplayNameRequired()); APP.store.dispatch(setPrejoinDisplayNameRequired());
} }
checkForAttachParametersAndConnect(id, password, connection); connection.connect({
id,
password
});
}); });
} }

View File

@ -1,3 +0,0 @@
module.exports = {
'extends': '../react/.eslintrc.js'
};

View File

@ -1,86 +0,0 @@
/* global config, createConnectionExternally */
import getRoomName from '../react/features/base/config/getRoomName';
import { parseURLParams } from '../react/features/base/util/parseURLParams';
/**
* Implements external connect using createConnectionExternally function defined
* in external_connect.js for Jitsi Meet. Parses the room name and JSON Web
* Token (JWT) from the URL and executes createConnectionExternally.
*
* NOTE: If you are using lib-jitsi-meet without Jitsi Meet, you should use this
* file as reference only because the implementation is Jitsi Meet-specific.
*
* NOTE: For optimal results this file should be included right after
* external_connect.js.
*/
if (typeof createConnectionExternally === 'function') {
// URL params have higher priority than config params.
// Do not use external connect if websocket is enabled.
let url
= parseURLParams(window.location, true, 'hash')[
'config.externalConnectUrl']
|| config.websocket ? undefined : config.externalConnectUrl;
const isRecorder
= parseURLParams(window.location, true, 'hash')['config.iAmRecorder'];
let roomName;
if (url && (roomName = getRoomName()) && !isRecorder) {
url += `?room=${roomName}`;
const token = parseURLParams(window.location, true, 'search').jwt;
if (token) {
url += `&token=${token}`;
}
createConnectionExternally(
url,
connectionInfo => {
// Sets that global variable to be used later by connect method
// in connection.js.
window.XMPPAttachInfo = {
status: 'success',
data: connectionInfo
};
checkForConnectHandlerAndConnect();
},
errorCallback);
} else {
errorCallback();
}
} else {
errorCallback();
}
/**
* Check if connect from connection.js was executed and executes the handler
* that is going to finish the connect work.
*
* @returns {void}
*/
function checkForConnectHandlerAndConnect() {
window.APP
&& window.APP.connect.status === 'ready'
&& window.APP.connect.handler();
}
/**
* Implements a callback to be invoked if anything goes wrong.
*
* @param {Error} error - The specifics of what went wrong.
* @returns {void}
*/
function errorCallback(error) {
// The value of error is undefined if external connect is disabled.
error && console.warn(error);
// Sets that global variable to be used later by connect method in
// connection.js.
window.XMPPAttachInfo = {
status: 'error'
};
checkForConnectHandlerAndConnect();
}

View File

@ -8,7 +8,6 @@ sounds /usr/share/jitsi-meet/
fonts /usr/share/jitsi-meet/ fonts /usr/share/jitsi-meet/
images /usr/share/jitsi-meet/ images /usr/share/jitsi-meet/
lang /usr/share/jitsi-meet/ lang /usr/share/jitsi-meet/
connection_optimization /usr/share/jitsi-meet/
resources/robots.txt /usr/share/jitsi-meet/ resources/robots.txt /usr/share/jitsi-meet/
resources/*.sh /usr/share/jitsi-meet/scripts/ resources/*.sh /usr/share/jitsi-meet/scripts/
pwa-worker.js /usr/share/jitsi-meet/ pwa-worker.js /usr/share/jitsi-meet/

View File

@ -93,7 +93,7 @@ server {
} }
# ensure all static content can always be found first # ensure all static content can always be found first
location ~ ^/(libs|css|static|images|fonts|lang|sounds|connection_optimization|.well-known)/(.*)$ location ~ ^/(libs|css|static|images|fonts|lang|sounds|.well-known)/(.*)$
{ {
add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Origin' '*';
alias /usr/share/jitsi-meet/$1/$2; alias /usr/share/jitsi-meet/$1/$2;

View File

@ -182,8 +182,6 @@
'error', loadErrHandler, true /* capture phase type of listener */); 'error', loadErrHandler, true /* capture phase type of listener */);
</script> </script>
<script><!--#include virtual="/config.js" --></script><!-- adapt to your needs, i.e. set hosts and bosh path --> <script><!--#include virtual="/config.js" --></script><!-- adapt to your needs, i.e. set hosts and bosh path -->
<!--#include virtual="connection_optimization/connection_optimization.html" -->
<script src="libs/do_external_connect.min.js?v=1"></script>
<script><!--#include virtual="/interface_config.js" --></script> <script><!--#include virtual="/interface_config.js" --></script>
<script src="libs/lib-jitsi-meet.min.js?v=139"></script> <script src="libs/lib-jitsi-meet.min.js?v=139"></script>
<script src="libs/app.bundle.min.js?v=139"></script> <script src="libs/app.bundle.min.js?v=139"></script>

10
package-lock.json generated
View File

@ -71,7 +71,7 @@
"js-md5": "0.6.1", "js-md5": "0.6.1",
"js-sha512": "0.8.0", "js-sha512": "0.8.0",
"jwt-decode": "2.2.0", "jwt-decode": "2.2.0",
"lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1583.0.0+931ca368/lib-jitsi-meet.tgz", "lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1585.0.0+362d1b2c/lib-jitsi-meet.tgz",
"lodash": "4.17.21", "lodash": "4.17.21",
"moment": "2.29.4", "moment": "2.29.4",
"moment-duration-format": "2.2.2", "moment-duration-format": "2.2.2",
@ -13399,8 +13399,8 @@
}, },
"node_modules/lib-jitsi-meet": { "node_modules/lib-jitsi-meet": {
"version": "0.0.0", "version": "0.0.0",
"resolved": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1583.0.0+931ca368/lib-jitsi-meet.tgz", "resolved": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1585.0.0+362d1b2c/lib-jitsi-meet.tgz",
"integrity": "sha512-lzgRkJtdlZ7bfq2seBuONRM6UND8NJVjMOZPlVoq7uP4UuxffBztsoHGc0g5Y5zEqi1AnfYLwVZZvXkpd82iew==", "integrity": "sha512-g7JVvBfZixl1fKZI4ZMm3nvMasEz5sdapMzZdc76kA/eZSej2QuNK+W9cB8IypB7dqeTM4yzbfzi9rDipyWn+w==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@jitsi/js-utils": "2.0.0", "@jitsi/js-utils": "2.0.0",
@ -30278,8 +30278,8 @@
} }
}, },
"lib-jitsi-meet": { "lib-jitsi-meet": {
"version": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1583.0.0+931ca368/lib-jitsi-meet.tgz", "version": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1585.0.0+362d1b2c/lib-jitsi-meet.tgz",
"integrity": "sha512-lzgRkJtdlZ7bfq2seBuONRM6UND8NJVjMOZPlVoq7uP4UuxffBztsoHGc0g5Y5zEqi1AnfYLwVZZvXkpd82iew==", "integrity": "sha512-g7JVvBfZixl1fKZI4ZMm3nvMasEz5sdapMzZdc76kA/eZSej2QuNK+W9cB8IypB7dqeTM4yzbfzi9rDipyWn+w==",
"requires": { "requires": {
"@jitsi/js-utils": "2.0.0", "@jitsi/js-utils": "2.0.0",
"@jitsi/logger": "2.0.0", "@jitsi/logger": "2.0.0",

View File

@ -76,7 +76,7 @@
"js-md5": "0.6.1", "js-md5": "0.6.1",
"js-sha512": "0.8.0", "js-sha512": "0.8.0",
"jwt-decode": "2.2.0", "jwt-decode": "2.2.0",
"lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1583.0.0+931ca368/lib-jitsi-meet.tgz", "lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1585.0.0+362d1b2c/lib-jitsi-meet.tgz",
"lodash": "4.17.21", "lodash": "4.17.21",
"moment": "2.29.4", "moment": "2.29.4",
"moment-duration-format": "2.2.2", "moment-duration-format": "2.2.2",

View File

@ -322,16 +322,6 @@ module.exports = (_env, argv) => {
], ],
performance: getPerformanceHints(perfHintOptions, 800 * 1024) performance: getPerformanceHints(perfHintOptions, 800 * 1024)
}), }),
Object.assign({}, config, {
entry: {
'do_external_connect': './connection_optimization/do_external_connect.js'
},
plugins: [
...config.plugins,
...getBundleAnalyzerPlugin(analyzeBundle, 'do_external_connect')
],
performance: getPerformanceHints(perfHintOptions, 5 * 1024)
}),
Object.assign({}, config, { Object.assign({}, config, {
entry: { entry: {
'analytics-ga': './react/features/analytics/handlers/GoogleAnalyticsHandler.ts' 'analytics-ga': './react/features/analytics/handlers/GoogleAnalyticsHandler.ts'