{"record":{"id":"b0b223ded0361ea2","repo":"Foundry376/Mailspring","slug":"cannot-modify-event-in-read-only-calendar","errorCode":null,"errorMessage":"Cannot modify event in read-only calendar","messagePattern":"Cannot modify event in read-only calendar","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/internal_packages/main-calendar/lib/core/mailspring-calendar.tsx","lineNumber":773,"sourceCode":"   * Persist the drag change to the database.\n   * Undo support is automatically provided by SyncbackEventTask.\n   */\n  async _persistDragChange(dragState: DragState): Promise<void> {\n    // Clear the drag state immediately for responsive UI\n    this.setState({ dragState: null });\n\n    try {\n      // Parse the event ID from the occurrence ID\n      const eventId = parseEventIdFromOccurrence(dragState.event.id);\n\n      const event = await DatabaseStore.find<Event>(Event, eventId);\n      if (!event) {\n        console.error('Could not find event to update:', eventId);\n        return;\n      }\n\n      if (this._isCalendarReadOnly(event.calendarId)) {\n        console.warn('Cannot modify event in read-only calendar');\n        return;\n      }\n\n      // Handle all-day events - snap times to day boundaries\n      let newStart = dragState.previewStart;\n      let newEnd = dragState.previewEnd;\n\n      if (dragState.previewIsAllDay) {\n        const snapped = snapAllDayTimes(newStart, newEnd);\n        newStart = snapped.start;\n        newEnd = snapped.end;\n      }\n\n      // Use shared utility for the modification logic (includes undo support)\n      const options: EventTimeChangeOptions = {\n        event,\n        // For inline exceptions, use the RECURRENCE-ID value (recurrenceIdStart), NOT the\n        // exception's moved DTSTART (start). Using start would produce the wrong RECURRENCE-ID","sourceCodeStart":755,"sourceCodeEnd":791,"githubUrl":"https://github.com/Foundry376/Mailspring/blob/648c685d602ece6bb00c22534b8734de6ac644b3/app/internal_packages/main-calendar/lib/core/mailspring-calendar.tsx#L755-L791","documentation":"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.","triggerScenarios":"Thrown at app/internal_packages/main-calendar/lib/core/mailspring-calendar.tsx:773 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Copy the event to a writable calendar and drag the copy","Ask the calendar owner for write access, or subscribe with edit permissions"],"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"}