From 741144bff2bd0cd9fbc19f921181afeddfcc4512 Mon Sep 17 00:00:00 2001 From: Bandhan Majumder <133476557+bandhan-majumder@users.noreply.github.com> Date: Thu, 4 Dec 2025 11:19:34 +0530 Subject: [PATCH] fix: correct busy slot title for ics feed integration troubleshoot (#23929) * fix: correct busy slot title for ics feed integration troubleshoot * Prevent 'as' call by wrapping getFirstPropertyValue in string --------- Co-authored-by: Kartik Saini <41051387+kart1ka@users.noreply.github.com> Co-authored-by: Pallav <90088723+Pallava-Joshi@users.noreply.github.com> Co-authored-by: Alex van Andel --- .../app-store/ics-feedcalendar/lib/CalendarService.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/app-store/ics-feedcalendar/lib/CalendarService.ts b/packages/app-store/ics-feedcalendar/lib/CalendarService.ts index b64d9aec30..fb10e9206b 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, }); }); });