Skip to content

Commit 1054ccf

Browse files
authored
Improve logging of invitation errors and skip importing 'CANCELLED' talks (#171)
1 parent 0786d43 commit 1054ccf

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/backends/penta/PentabarfParser.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,13 @@ export class PentabarfParser {
197197
for (const pEvent of arrayLike(pRoom.event)) {
198198
if (!pEvent) continue;
199199

200+
if (pEvent.title.startsWith("CANCELLED ")) {
201+
// FOSDEM represents cancelled talks with a title prefix.
202+
// There is currently no more 'proper' way to get this information.
203+
LogService.info("PentabarfParser", `Talk '${pEvent.attr?.["@_id"]}' has CANCELLED in prefix of title: ignoring.`)
204+
continue;
205+
}
206+
200207
const parsedStartTime = simpleTimeParse(pEvent.start);
201208
const parsedDuration = simpleTimeParse(pEvent.duration);
202209
const startTime = moment(dateTs).add(parsedStartTime.hours, 'hours').add(parsedStartTime.minutes, 'minutes');

src/commands/actions/people.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,15 @@ export async function doAuditoriumResolveAction(
3434
skipTalks = false,
3535
isInvite = true,
3636
): Promise<void> {
37+
const audId = await aud.getId();
3738
// We know that everyone should be in the backstage room, so resolve that list of people
3839
// to make the identity server lookup efficient.
3940
const backstagePeople = isInvite
4041
? await conference.getInviteTargetsForAuditorium(aud, true)
4142
: await conference.getModeratorsForAuditorium(aud);
4243
LogService.info("backstagePeople", `${backstagePeople}`);
4344
const resolvedBackstagePeople = await resolveIdentifiers(backstagePeople);
44-
const backstage = conference.getAuditoriumBackstage(await aud.getId());
45+
const backstage = conference.getAuditoriumBackstage(audId);
4546

4647
LogService.info("resolvedBackstagePeople", `${resolvedBackstagePeople}`);
4748

@@ -53,12 +54,12 @@ export async function doAuditoriumResolveAction(
5354

5455
if (backstageOnly) return;
5556

56-
const realAud = conference.getAuditorium(await aud.getId());
57+
const realAud = conference.getAuditorium(audId);
5758
const audPeople = isInvite
5859
? await conference.getInviteTargetsForAuditorium(realAud)
5960
: await conference.getModeratorsForAuditorium(realAud);
6061
const resolvedAudPeople = audPeople.map(p => allPossiblePeople.find(b => p.id === b.person.id));
61-
if (resolvedAudPeople.some(p => !p)) throw new Error("Failed to resolve all targets for auditorium");
62+
if (resolvedAudPeople.some(p => !p)) throw new Error(`Failed to resolve all targets for auditorium ${audId}`);
6263

6364
await action(client, realAud.roomId, resolvedAudPeople as ResolvedPersonIdentifier[]);
6465

@@ -78,7 +79,7 @@ export async function doAuditoriumResolveAction(
7879
const unresolveable = talkPeople.filter(
7980
p => allPossiblePeople.find(b => p.id === b.person.id) === undefined
8081
)
81-
throw new Error("Failed to resolve all targets for talk: " + JSON.stringify(unresolveable));
82+
throw new Error(`Failed to resolve all targets for talk ${await talk.getId()}: ` + JSON.stringify(unresolveable));
8283
}
8384

8485
await action(client, talk.roomId, resolvedTalkPeople as ResolvedPersonIdentifier[]);

0 commit comments

Comments
 (0)