Skip to content

Commit

Permalink
feat(spot-client) drop API health-check
Browse files Browse the repository at this point in the history
It's prone to false positives. The meeting itself can generate an error
and the user can hangup from the remote if there is a problem.
Automating this is dangerous because we don't know what can happen that
may cause a false positive.
  • Loading branch information
saghul committed Nov 21, 2023
1 parent df6ddee commit 0636ea2
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 252 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import PropTypes from 'prop-types';
import React from 'react';
import { MESSAGE_TYPES, nativeController } from 'spot-tv/native-functions';

import { ApiHealthCheck } from './ApiHealthCheck';

/**
* Common code shared between vendor specific meeting frame components.
Expand Down Expand Up @@ -45,14 +44,6 @@ export default class AbstractMeetingFrame extends React.Component {
constructor(props, meetingType) {
super(props);

/**
* The API health checker instance.
*
* @type {ApiHealthCheck|undefined}
* @private
*/
this._apiHealthChecks = undefined;

/**
* The max number of participants that was at some point in the meeting. The value should be updated by
* the vendor specific meeting frame class.
Expand All @@ -73,31 +64,12 @@ export default class AbstractMeetingFrame extends React.Component {
this.meetingType = meetingType;

bindAll(this, [
'_onApiHealthCheckError',
'_onMeetingCommandReceived',
'_onMeetingJoined',
'_onMeetingLeave'
]);
}

/**
* Enables and starts the API health checks.
*
* @param {Function} healthCheckFunction - A function which returns a promise which is supposed to check the API by
* doing a ping or other short operation which would confirm that the API is responsive. The health check will fail
* if the promise will not resolve withing the time limit or if rejected. Check {@link ApiHealthCheck} for more
* details.
* @protected
* @returns {void}
*/
_enableApiHealthChecks(healthCheckFunction) {
this._apiHealthChecks = new ApiHealthCheck(
healthCheckFunction,
this._onApiHealthCheckError
);
this._apiHealthChecks.start();
}

/**
* Initialize the frame.
*
Expand All @@ -121,8 +93,6 @@ export default class AbstractMeetingFrame extends React.Component {
* @returns {void}
*/
componentWillUnmount() {
this._apiHealthChecks && this._apiHealthChecks.stop();

this.props.remoteControlServer.removeListener(
SERVICE_UPDATES.CLIENT_MESSAGE_RECEIVED,
this._onMeetingCommandReceived
Expand All @@ -134,22 +104,6 @@ export default class AbstractMeetingFrame extends React.Component {
);
}

/**
* Callback invoked when the iFrame is not responsive.
*
* @param {string} reason - The detected reason for the failed health check.
* @private
* @returns {void}
*/
_onApiHealthCheckError(reason) {
logger.error('api health check failed', { reason });

this._onMeetingLeave({
errorCode: reason,
error: 'appEvents.meetingConnectionLost'
});
}

/**
* Callback invoked when a Spot-Remote is requesting a change to the
* meeting.
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,6 @@ export class JitsiMeetingFrame extends AbstractMeetingFrame {
_onMeetingJoined() {
this._meetingJoined = true;

this._enableApiHealthChecks(() => this._jitsiApi.isVideoMuted());

super._onMeetingJoined();

this._trySendResizeFilmStripCommand();
Expand Down

0 comments on commit 0636ea2

Please sign in to comment.