Foundry376/Mailspring · error

EventHeader: Could not parse ICS data from attachment ${file

Error message

EventHeader: Could not parse ICS data from attachment ${file.filename}: ${e.message}

What it means

Warning in EventHeader.componentDidMount: the .ics attachment file was read from disk but CalendarUtils.parseICSString threw while parsing it, so the emailed invite could not be displayed as an event header. Corrupt or non-standard ICS payload; the header silently skips rendering the RSVP UI.

Source

Thrown at app/internal_packages/events/lib/event-header.tsx:77

  componentWillUnmount() {
    this._mounted = false;
    if (this._subscription) {
      this._subscription.dispose();
    }
  }

  componentDidMount() {
    const { file, message } = this.props;
    this._mounted = true;

    fs.readFile(AttachmentStore.pathForFile(file), async (err, data) => {
      if (err || !this._mounted) return;

      let parsed: ReturnType<typeof CalendarUtils.parseICSString>;
      try {
        parsed = CalendarUtils.parseICSString(data.toString());
      } catch (e) {
        console.warn(
          `EventHeader: Could not parse ICS data from attachment ${file.filename}: ${e.message}`
        );
        return;
      }
      const { event, root } = parsed;

      const method = root.getFirstPropertyValue('method');
      const methodLower = (typeof method === 'string' ? method : 'request').toLowerCase();
      // Normalize to known methods: request, reply, cancel. Default unknown methods to request.
      const normalizedMethod =
        methodLower === 'reply' || methodLower === 'cancel' ? methodLower : 'request';
      this.setState({
        icsEvent: event,
        icsMethod: normalizedMethod as 'reply' | 'request' | 'cancel',
        icsOriginalData: data.toString(),
      });

      this._subscription = Rx.Observable.fromQuery(

View on GitHub (pinned to 648c685d60)

Solutions

  1. No user action available in-app — the attachment is malformed
  2. Log or report the attachment filename so badly-generated invites (buggy organizer software) can be identified
  3. Render a plain fallback view of the attachment instead of nothing
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at app/internal_packages/events/lib/event-header.tsx:77 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Foundry376/Mailspring@648c685d60 (2026-09-03). Data as JSON: /api/errors/d9b992e463216acc. Report an issue: GitHub.