Skip to content

Scheduling infrastructure for absolutely everyone.

fix: correct busy slot title for ics feed integration troubleshoot (#23929)

Bandhan Majumder741144bff2bd
diff --git a/packages/app-store/ics-feedcalendar/lib/CalendarService.ts b/packages/app-store/ics-feedcalendar/lib/CalendarService.ts
index b64d9aec30b..fb10e9206bb 100644
--- a/packages/app-store/ics-feedcalendar/lib/CalendarService.ts
+++ b/packages/app-store/ics-feedcalendar/lib/CalendarService.ts
@@ -24,7 +24,7 @@ const getTravelDurationInSeconds = (vevent: ICAL.Component) => {
// integer validation as we can never be sure with ical.js
if (!Number.isInteger(travelSeconds)) return 0;
return travelSeconds;
- } catch (e) {
+ } catch {
return 0;
}
};
@@ -146,7 +146,7 @@ export default class ICSFeedCalendarService implements Calendar {
const userId = this.getUserId(selectedCalendars);
// we use the userId from selectedCalendars to fetch the user's timeZone from the database primarily for all-day events without any timezone information
const userTimeZone = userId ? await this.getUserTimezoneFromDB(userId) : "Europe/London";
- const events: { start: string; end: string }[] = [];
+ const events: { start: string; end: string; title: string }[] = [];
calendars.forEach(({ vcalendar }) => {
const vevents = vcalendar.getAllSubcomponents("vevent");
@@ -159,7 +159,9 @@ export default class ICSFeedCalendarService implements Calendar {
// if (vevent?.getFirstPropertyValue("transp") === "TRANSPARENT") return;
const event = new ICAL.Event(vevent);
+ const title = String(vevent.getFirstPropertyValue("summary"));
const dtstartProperty = vevent.getFirstProperty("dtstart");
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
const tzidFromDtstart = dtstartProperty ? (dtstartProperty as any).jCal[1].tzid : undefined;
const dtstart: { [key: string]: string } | undefined = vevent?.getFirstPropertyValue("dtstart");
@@ -263,6 +265,7 @@ export default class ICSFeedCalendarService implements Calendar {
events.push({
start: currentStart.toISOString(),
end: dayjs(currentEvent.endDate.toJSDate()).toISOString(),
+ title,
});
}
}
@@ -283,6 +286,7 @@ export default class ICSFeedCalendarService implements Calendar {
return events.push({
start: finalStartISO,
end: finalEndISO,
+ title,
});
});
});