Skip to content
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
8 changes: 6 additions & 2 deletions packages/app-store/ics-feedcalendar/lib/CalendarService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
};
Expand Down Expand Up @@ -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");
Expand All @@ -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"));
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Dec 4, 2025

Choose a reason for hiding this comment

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

P2: String(null) returns the literal string "null" and String(undefined) returns "undefined". If an ICS event lacks a SUMMARY property (which is optional per RFC 5545), the title will display as "null" instead of an empty string or fallback value.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/app-store/ics-feedcalendar/lib/CalendarService.ts, line 162:

<comment>`String(null)` returns the literal string `&quot;null&quot;` and `String(undefined)` returns `&quot;undefined&quot;`. If an ICS event lacks a SUMMARY property (which is optional per RFC 5545), the title will display as &quot;null&quot; instead of an empty string or fallback value.</comment>

<file context>
@@ -159,7 +159,9 @@ export default class ICSFeedCalendarService implements Calendar {
         // if (vevent?.getFirstPropertyValue(&quot;transp&quot;) === &quot;TRANSPARENT&quot;) return;
 
         const event = new ICAL.Event(vevent);
+        const title = String(vevent.getFirstPropertyValue(&quot;summary&quot;));
         const dtstartProperty = vevent.getFirstProperty(&quot;dtstart&quot;);
+        // eslint-disable-next-line @typescript-eslint/no-explicit-any
</file context>
Suggested change
const title = String(vevent.getFirstPropertyValue("summary"));
const title = String(vevent.getFirstPropertyValue("summary") ?? "");
Fix with Cubic

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");
Expand Down Expand Up @@ -263,6 +265,7 @@ export default class ICSFeedCalendarService implements Calendar {
events.push({
start: currentStart.toISOString(),
end: dayjs(currentEvent.endDate.toJSDate()).toISOString(),
title,
});
}
}
Expand All @@ -283,6 +286,7 @@ export default class ICSFeedCalendarService implements Calendar {
return events.push({
start: finalStartISO,
end: finalEndISO,
title,
});
});
});
Expand Down
Loading