Foundry376/Mailspring · error

Cannot modify event in read-only calendar

Error message

Cannot modify event in read-only calendar

What it means

Guard while persisting a drag-reschedule in the main calendar: the target Event belongs to a read-only calendar (e.g. a subscribed or other-user's calendar), so the SyncbackEventTask cannot write changes and the drag is rolled back by refusing to persist.

Source

Thrown at app/internal_packages/main-calendar/lib/core/mailspring-calendar.tsx:773

   * Persist the drag change to the database.
   * Undo support is automatically provided by SyncbackEventTask.
   */
  async _persistDragChange(dragState: DragState): Promise<void> {
    // Clear the drag state immediately for responsive UI
    this.setState({ dragState: null });

    try {
      // Parse the event ID from the occurrence ID
      const eventId = parseEventIdFromOccurrence(dragState.event.id);

      const event = await DatabaseStore.find<Event>(Event, eventId);
      if (!event) {
        console.error('Could not find event to update:', eventId);
        return;
      }

      if (this._isCalendarReadOnly(event.calendarId)) {
        console.warn('Cannot modify event in read-only calendar');
        return;
      }

      // Handle all-day events - snap times to day boundaries
      let newStart = dragState.previewStart;
      let newEnd = dragState.previewEnd;

      if (dragState.previewIsAllDay) {
        const snapped = snapAllDayTimes(newStart, newEnd);
        newStart = snapped.start;
        newEnd = snapped.end;
      }

      // Use shared utility for the modification logic (includes undo support)
      const options: EventTimeChangeOptions = {
        event,
        // For inline exceptions, use the RECURRENCE-ID value (recurrenceIdStart), NOT the
        // exception's moved DTSTART (start). Using start would produce the wrong RECURRENCE-ID

View on GitHub (pinned to 648c685d60)

Solutions

  1. Copy the event to a writable calendar and drag the copy
  2. Ask the calendar owner for write access, or subscribe with edit permissions
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at app/internal_packages/main-calendar/lib/core/mailspring-calendar.tsx:773 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/b0b223ded0361ea2. Report an issue: GitHub.