Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection errors notifications #15306

Merged
merged 2 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lang/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,7 @@
"connectedOneMember": "{{name}} joined the meeting",
"connectedThreePlusMembers": "{{name}} and many others joined the meeting",
"connectedTwoMembers": "{{first}} and {{second}} joined the meeting",
"connectionFailed": "Connection failed. Please try again later!",
"dataChannelClosed": "Video quality may be impaired",
"dataChannelClosedDescription": "The bridge channel is down and thus video quality may be limited to its lowest setting.",
"dataChannelClosedDescriptionWithAudio": "The bridge channel is down and thus disruptions to audio and video may occur.",
Expand All @@ -753,6 +754,9 @@
"gifsMenu": "GIPHY",
"groupTitle": "Notifications",
"hostAskedUnmute": "The moderator would like you to speak",
"invalidTenant": "Invalid tenant",
"invalidTenantHyphenDescription": "The tenant you are using is invalid (starts or ends with '-').",
"invalidTenantLengthDescription": "The tenant you are using is too long.",
"invitedOneMember": "{{name}} has been invited",
"invitedThreePlusMembers": "{{name}} and {{count}} others have been invited",
"invitedTwoMembers": "{{first}} and {{second}} have been invited",
Expand Down
28 changes: 27 additions & 1 deletion react/features/base/conference/middleware.any.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ import { IStore } from '../../app/types';
import { removeLobbyChatParticipant } from '../../chat/actions.any';
import { openDisplayNamePrompt } from '../../display-name/actions';
import { isVpaasMeeting } from '../../jaas/functions';
import { showErrorNotification } from '../../notifications/actions';
import { showErrorNotification, showNotification } from '../../notifications/actions';
import { NOTIFICATION_TIMEOUT_TYPE } from '../../notifications/constants';
import { INotificationProps } from '../../notifications/types';
import { hasDisplayName } from '../../prejoin/utils';
import { stopLocalVideoRecording } from '../../recording/actions.any';
import LocalRecordingManager from '../../recording/components/Recording/LocalRecordingManager';
Expand All @@ -37,6 +38,7 @@ import {
import MiddlewareRegistry from '../redux/MiddlewareRegistry';
import StateListenerRegistry from '../redux/StateListenerRegistry';
import { TRACK_ADDED, TRACK_REMOVED } from '../tracks/actionTypes';
import { parseURIString } from '../util/uri';

import {
CONFERENCE_FAILED,
Expand Down Expand Up @@ -419,6 +421,30 @@ function _connectionFailed({ dispatch, getState }: IStore, next: Function, actio
}
}

if (error.name === JitsiConnectionErrors.CONFERENCE_REQUEST_FAILED) {
let notificationAction: Function = showNotification;
const notificationProps = {
customActionNameKey: [ 'dialog.rejoinNow' ],
customActionHandler: [ () => dispatch(reloadNow()) ],
descriptionKey: 'notify.connectionFailed'
} as INotificationProps;

const { locationURL = { href: '' } as URL } = getState()['features/base/connection'];
const { tenant } = parseURIString(locationURL.href) || {};

if (tenant.startsWith('-') || tenant.endsWith('-')) {
notificationProps.descriptionKey = 'notify.invalidTenantHyphenDescription';
notificationProps.titleKey = 'notify.invalidTenant';
notificationAction = showErrorNotification;
} else if (tenant.length > 63) {
notificationProps.descriptionKey = 'notify.invalidTenantLengthDescription';
notificationProps.titleKey = 'notify.invalidTenant';
notificationAction = showErrorNotification;
}

dispatch(notificationAction(notificationProps, NOTIFICATION_TIMEOUT_TYPE.STICKY));
}

const result = next(action);

_removeUnloadHandler(getState);
Expand Down
5 changes: 2 additions & 3 deletions react/features/base/connection/actions.any.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { IReduxState, IStore } from '../../app/types';
import { conferenceLeft, conferenceWillLeave, redirect } from '../conference/actions';
import { getCurrentConference } from '../conference/functions';
import { IConfigState } from '../config/reducer';
import JitsiMeetJS, { JitsiConnectionErrors, JitsiConnectionEvents } from '../lib-jitsi-meet';
import JitsiMeetJS, { JitsiConnectionEvents } from '../lib-jitsi-meet';
import { parseURLParams } from '../util/parseURLParams';
import {
appendURLParam,
Expand Down Expand Up @@ -288,8 +288,7 @@ export function _connectInternal(id?: string, password?: string) {
credentials,
details,
name: err,
message,
recoverable: err === JitsiConnectionErrors.CONFERENCE_REQUEST_FAILED ? false : undefined
message
}));

reject(err);
Expand Down
3 changes: 1 addition & 2 deletions react/features/base/lib-jitsi-meet/functions.any.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ export function isFatalJitsiConnectionError(error: Error | string | ConnectionFa
}

return (
error === JitsiConnectionErrors.CONFERENCE_REQUEST_FAILED
|| error === JitsiConnectionErrors.CONNECTION_DROPPED_ERROR
error === JitsiConnectionErrors.CONNECTION_DROPPED_ERROR
saghul marked this conversation as resolved.
Show resolved Hide resolved
|| error === JitsiConnectionErrors.OTHER_ERROR
|| error === JitsiConnectionErrors.SERVER_ERROR);
}