feat(reload): on offer / answer error.
This commit is contained in:
@@ -271,6 +271,18 @@ export function createInviteDialogEvent(
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an "offer/answer failure" event.
|
||||
*
|
||||
* @returns {Object} The event in a format suitable for sending via
|
||||
* sendAnalytics.
|
||||
*/
|
||||
export function createOfferAnswerFailedEvent() {
|
||||
return {
|
||||
action: 'offer.answer.failure'
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a "page reload" event.
|
||||
*
|
||||
|
||||
@@ -6,10 +6,12 @@ import {
|
||||
ACTION_UNPINNED,
|
||||
createAudioOnlyChangedEvent,
|
||||
createConnectionEvent,
|
||||
createOfferAnswerFailedEvent,
|
||||
createPinnedEvent,
|
||||
sendAnalytics
|
||||
} from '../../analytics';
|
||||
import { CONNECTION_ESTABLISHED, CONNECTION_FAILED } from '../connection';
|
||||
import { JitsiConferenceErrors } from '../lib-jitsi-meet';
|
||||
import { setVideoMuted, VIDEO_MUTISM_AUTHORITY } from '../media';
|
||||
import {
|
||||
getLocalParticipant,
|
||||
@@ -152,6 +154,12 @@ StateListenerRegistry.register(
|
||||
function _conferenceFailed(store, next, action) {
|
||||
const result = next(action);
|
||||
|
||||
const { conference, error } = action;
|
||||
|
||||
if (error.name === JitsiConferenceErrors.OFFER_ANSWER_FAILED) {
|
||||
sendAnalytics(createOfferAnswerFailedEvent());
|
||||
}
|
||||
|
||||
// FIXME: Workaround for the web version. Currently, the creation of the
|
||||
// conference is handled by /conference.js and appropriate failure handlers
|
||||
// are set there.
|
||||
@@ -165,8 +173,6 @@ function _conferenceFailed(store, next, action) {
|
||||
}
|
||||
|
||||
// XXX After next(action), it is clear whether the error is recoverable.
|
||||
const { conference, error } = action;
|
||||
|
||||
!error.recoverable
|
||||
&& conference
|
||||
&& conference.leave().catch(reason => {
|
||||
|
||||
@@ -70,6 +70,7 @@ export function isFatalJitsiConferenceError(error: Object | string) {
|
||||
return (
|
||||
error === JitsiConferenceErrors.FOCUS_DISCONNECTED
|
||||
|| error === JitsiConferenceErrors.FOCUS_LEFT
|
||||
|| error === JitsiConferenceErrors.OFFER_ANSWER_FAILED
|
||||
|| error === JitsiConferenceErrors.VIDEOBRIDGE_NOT_AVAILABLE);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user