{"record":{"id":"375735102e16e394","repo":"Foundry376/Mailspring","slug":"invalid-ics-no-vevent-component-found","errorCode":null,"errorMessage":"Invalid ICS: no VEVENT component found","messagePattern":"Invalid ICS: no VEVENT component found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/ics-event-helpers.ts","lineNumber":460,"sourceCode":" *\n * @param ics - The original ICS string\n * @param options - New start/end times and whether it's an all-day event\n * @returns The modified ICS string\n */\nexport function updateEventTimes(ics: string, options: UpdateTimesOptions): string {\n  // Validate inputs\n  validateTimestamps(options.start, options.end);\n\n  const ical = getICAL();\n  const { root, event } = parseICSString(ics);\n\n  const startDate = new Date(options.start * 1000);\n  const endDate = new Date(options.end * 1000);\n  const isAllDay = options.isAllDay ?? false;\n\n  const vevent = root.name === 'vevent' ? root : root.getFirstSubcomponent('vevent');\n  if (!vevent) {\n    throw new Error('Invalid ICS: no VEVENT component found');\n  }\n\n  if (!isAllDay && options.timezone) {\n    // User selected a specific timezone — encode wall-clock time in that zone.\n    // This mirrors the timezone path in createICSString.\n    const momentTz = require('moment-timezone');\n    const startM = momentTz(startDate).tz(options.timezone);\n    const endM = momentTz(endDate).tz(options.timezone);\n\n    event.startDate = new ical.Time(\n      {\n        year: startM.year(),\n        month: startM.month() + 1,\n        day: startM.date(),\n        hour: startM.hour(),\n        minute: startM.minute(),\n        second: startM.second(),\n        isDate: false,","sourceCodeStart":442,"sourceCodeEnd":478,"githubUrl":"https://github.com/Foundry376/Mailspring/blob/648c685d602ece6bb00c22534b8734de6ac644b3/app/src/ics-event-helpers.ts#L442-L478","documentation":"Guard in ics-event-helpers when rescheduling: after parsing the ICS string, neither the root component nor its first sub-component is a VEVENT, so there is no event whose times can be updated. Indicates a malformed/empty calendar payload or an ICS containing only VTODO/VJOURNAL.","triggerScenarios":"Thrown at app/src/ics-event-helpers.ts:460 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-export or re-fetch the event ICS from the organizer — the payload lacks a VEVENT","Validate the ICS with a calendar tool before passing it to updateEventTimes","Handle non-event calendar objects upstream instead of routing them to event editing"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"648c685d602ece6bb00c22534b8734de6ac644b3","analyzedAt":"2026-09-03T02:00:24.311Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}