diff --git a/app/.env b/app/.env new file mode 100644 index 0000000..86c714e --- /dev/null +++ b/app/.env @@ -0,0 +1,2 @@ +REACT_APP_VERSION=$npm_package_version +REACT_APP_NAME=$npm_package_name \ No newline at end of file diff --git a/app/public/config/config.example.js b/app/public/config/config.example.js index e07d994..bbd9a03 100644 --- a/app/public/config/config.example.js +++ b/app/public/config/config.example.js @@ -37,7 +37,8 @@ var config = 'opera' ], // Socket.io request timeout - requestTimeout : 10000, + requestTimeout : 20000, + requestRetries : 3, transportOptions : { tcp : true diff --git a/app/src/RoomClient.js b/app/src/RoomClient.js index 3e9bc46..8e823e3 100644 --- a/app/src/RoomClient.js +++ b/app/src/RoomClient.js @@ -1,6 +1,7 @@ import Logger from './Logger'; import hark from 'hark'; import { getSignalingUrl } from './urlFactory'; +import { SocketTimeoutError } from './utils'; import * as requestActions from './actions/requestActions'; import * as meActions from './actions/meActions'; import * as roomActions from './actions/roomActions'; @@ -574,7 +575,7 @@ export default class RoomClient if (called) return; called = true; - callback(new Error('Request timeout.')); + callback(new SocketTimeoutError('Request timed out')); }, ROOM_OPTIONS.requestTimeout ); @@ -590,13 +591,13 @@ export default class RoomClient }; } - sendRequest(method, data) + _sendRequest(method, data) { return new Promise((resolve, reject) => { if (!this._signalingSocket) { - reject('No socket connection.'); + reject('No socket connection'); } else { @@ -606,19 +607,42 @@ export default class RoomClient this.timeoutCallback((err, response) => { if (err) - { reject(err); - } else - { resolve(response); - } }) ); } }); } + async sendRequest(method, data) + { + logger.debug('sendRequest() [method:"%s", data:"%o"]', method, data); + + const { + requestRetries = 3 + } = window.config; + + for (let tries = 0; tries < requestRetries; tries++) + { + try + { + return await this._sendRequest(method, data); + } + catch (error) + { + if ( + error instanceof SocketTimeoutError && + tries < requestRetries + ) + logger.warn('sendRequest() | timeout, retrying [attempt:"%s"]', tries); + else + throw error; + } + } + } + async changeDisplayName(displayName) { logger.debug('changeDisplayName() [displayName:"%s"]', displayName); diff --git a/app/src/components/Controls/About.js b/app/src/components/Controls/About.js index d361a8c..c462549 100644 --- a/app/src/components/Controls/About.js +++ b/app/src/components/Controls/About.js @@ -42,8 +42,9 @@ const styles = (theme) => }, link : { - display : 'block', - textAlign : 'center' + display : 'block', + textAlign : 'center', + marginBottom : theme.spacing(1) } }); @@ -68,15 +69,16 @@ const About = ({ /> - + Contributions to this work were made on behalf of the GÉANT project, a project that has received funding from the European Union’s Horizon 2020 research and innovation programme under Grant Agreement No. 731122 (GN4-2). On behalf of GÉANT project, GÉANT Association is the sole owner of the copyright in all material which was developed - by a member of the GÉANT project.
-
+ by a member of the GÉANT project. +
+ GÉANT Vereniging (Association) is registered with the Chamber of Commerce in Amsterdam with registration number 40535155 and operates in the UK as a branch of GÉANT @@ -87,6 +89,13 @@ const About = ({ https://edumeet.org + + + :{` ${process.env.REACT_APP_VERSION}`} +
{ window.config.logo && Logo } diff --git a/app/src/components/Controls/TopBar.js b/app/src/components/Controls/TopBar.js index 148f4a7..d6ee365 100644 --- a/app/src/components/Controls/TopBar.js +++ b/app/src/components/Controls/TopBar.js @@ -479,35 +479,36 @@ const TopBar = (props) => > - - { lobbyPeers.length > 0 && - - - setLockDialogOpen(!room.lockDialogOpen)} - > - 0 && + + + setLockDialogOpen(!room.lockDialogOpen)} > - - - - - - } + + + + + + + } + +