Distinguish between an unknown meeting, and an meeting that's ended

This commit is contained in:
Andrew Morgan 2021-05-06 20:09:25 +01:00
parent 5c4927cd37
commit a06e002c28
2 changed files with 21 additions and 7 deletions

View file

@ -265,19 +265,27 @@ export class DimensionBigBlueButtonService {
@QueryParam("meetingId") meetingId: string,
@QueryParam("meetingPassword") password: string,
): Promise<BigBlueButtonCreateAndJoinMeetingResponse|ApiError> {
// Check if the meeting is actually running. If not, return an error
let isMeetingRunningParameters = {
// Check if the meeting exists and is running. If not, return an error for each case
let getMeetingInfoParameters = {
meetingID: meetingId,
}
const isMeetingRunningResponse = await this.makeBBBApiCall("GET", "isMeetingRunning", isMeetingRunningParameters, null);
if (isMeetingRunningResponse.running[0].toLowerCase() !== "true") {
// This meeting is not running, inform the user
const getMeetingInfoResponse = await this.makeBBBApiCall("GET", "getMeetingInfo", getMeetingInfoParameters, null);
LogService.info("BigBlueButton", getMeetingInfoResponse)
if (getMeetingInfoResponse.returncode[0] === "FAILED") {
// This meeting does not exist, inform the user
return new ApiError(
400,
{error: "This meeting does not exist or has ended."},
{error: "This meeting does not exist."},
"UNKNOWN_MEETING_ID",
);
} else if (getMeetingInfoResponse.running[0] === "false" && getMeetingInfoResponse.endTime[0] !== "0") {
// This meeting did exist, but has ended. Inform the user
return new ApiError(
400,
{error: "This meeting has ended."},
"MEETING_HAS_ENDED",
);
}
let joinQueryParameters = {

View file

@ -152,12 +152,18 @@ export class BigBlueButtonWidgetWrapperComponent extends CapableWidget implement
if ("errorCode" in response) {
// This is an instance of ApiError
if (response.errorCode === "UNKNOWN_MEETING_ID") {
// It's likely that everyone has left the meeting, and it's been garbage collected.
// This meeting ID is invalid.
// Inform the user that they should try and start a new meeting
this.statusMessage = "This meeting has ended or otherwise does not exist.<br>Please start a new meeting.";
return;
}
if (response.errorCode === "MEETING_HAS_ENDED") {
// It's likely that everyone has left the meeting, and it's been garbage collected.
// Inform the user that they should try and start a new meeting
this.statusMessage = "This meeting has ended.<br>Please start a new meeting.";
return;
}
// Otherwise this is a generic error
this.statusMessage = "An error occurred while loading the meeting";
}