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

Add more logging to attendance command #195

Merged
merged 3 commits into from
Nov 8, 2023
Merged
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
17 changes: 13 additions & 4 deletions src/commands/AttendanceCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ limitations under the License.
*/

import { ICommand } from "./ICommand";
import { MatrixClient } from "matrix-bot-sdk";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a drive-by cleanup - the import was unused.

import { Conference } from "../Conference";
import { resolveIdentifiers } from "../invites";
import { COLOR_GREEN, COLOR_RED } from "../models/colors";
Expand Down Expand Up @@ -67,7 +66,7 @@ export class AttendanceCommand implements ICommand {

if (bsRoomId) {
if (!bsPeople) {
throw new Error("bsRoomId set but bsPeople isn't!");
throw new Error(`the auditorium ${name} has a backstage room id but no backstage people set!`);
}
const bsInviteTargets = await resolveIdentifiers(this.client, bsPeople);
const bsJoinedMembers = await this.client.getJoinedRoomMembers(bsRoomId);
Expand All @@ -90,12 +89,22 @@ export class AttendanceCommand implements ICommand {
const bs = this.conference.getAuditoriumBackstage(await auditorium.getId());
const inviteTargets = await this.conference.getInviteTargetsForAuditorium(auditorium);
const bsInviteTargets = await this.conference.getInviteTargetsForAuditorium(auditorium, true);
await append(inviteTargets, bsInviteTargets, await auditorium.getId(), auditorium.roomId, bs.roomId, doAppend);
try {
await append(inviteTargets, bsInviteTargets, await auditorium.getId(), auditorium.roomId, bs.roomId, doAppend);
}
catch (error) {
throw new Error(`Error calculating invite acceptance in auditorium ${auditorium}`, {cause: error})
}
}
for (const spiRoom of this.conference.storedInterestRooms) {
const doAppend = !!targetAudId && (targetAudId === "all" || targetAudId === await spiRoom.getId());
const inviteTargets = await this.conference.getInviteTargetsForInterest(spiRoom);
await append(inviteTargets, null, await spiRoom.getId(), spiRoom.roomId, null, doAppend);
try {
await append(inviteTargets, null, await spiRoom.getId(), spiRoom.roomId, null, doAppend);
}
catch (error) {
throw new Error(`Error calculating invite acceptance in special interest room ${spiRoom}`, {cause:error})
}
}
html += "</ul>";

Expand Down
Loading