@@ -320,12 +320,8 @@ class Office365CalendarService implements Calendar {
320320 }
321321
322322 /**
323- * Updates an Office365 calendar event and handles seated attendee-only updates.
324- *
325- * @param uid - Office365 event identifier to update.
326- * @param event - Calendar event data to send to Microsoft Graph.
327- * @param externalCalendarId - Optional Office365 calendar identifier containing the event.
328- * @returns Updated Office365 event details.
323+ * Seated bookings split event-detail and attendee patches because Exchange can turn combined
324+ * attendee-list mutations into organizer-level updates for everyone on the event.
329325 */
330326 async updateEvent (
331327 uid : string ,
@@ -348,7 +344,6 @@ class Office365CalendarService implements Calendar {
348344 rescheduledEvent = await handleErrorsJson < Event > ( response ) ;
349345 }
350346
351- // Build the full translated event object
352347 const translatedEvent = this . translateEvent ( event , rescheduledEvent ) ;
353348
354349 let response : Response ;
@@ -386,26 +381,17 @@ class Office365CalendarService implements Calendar {
386381 lastError = err instanceof Error ? err : new Error ( String ( err ) ) ;
387382
388383 if ( attempt < MAX_RETRIES ) {
389- // Exponential backoff before next attempt
384+ // Exchange can lag after the first seated-booking patch, so retry attendee sync briefly.
390385 const backoff = BACKOFF_MS * 2 ** ( attempt - 1 ) ;
391386 this . log . warn (
392387 `PATCH_ATTENDEES attempt ${ attempt } /${ MAX_RETRIES } failed for event uid=${ uid } , retrying in ${ backoff } ms` ,
393388 { err }
394389 ) ;
395- await new Promise (
396- /**
397- * Resolves the retry delay after the computed backoff.
398- *
399- * @param resolve - Promise resolver called when the delay completes.
400- * @returns Timeout handle created for the retry delay.
401- */
402- ( resolve ) => setTimeout ( resolve , backoff )
403- ) ;
390+ await new Promise ( ( resolve ) => setTimeout ( resolve , backoff ) ) ;
404391 }
405392 }
406393 }
407394
408- // Retry failure handling for PATCH 2
409395 if ( lastError ) {
410396 let httpStatus : number | undefined ;
411397 let httpBody : unknown ;
@@ -415,14 +401,7 @@ class Office365CalendarService implements Calendar {
415401 try {
416402 httpBody = await patch2Response . json ( ) ;
417403 } catch {
418- httpBody = await patch2Response . text ( ) . catch (
419- /**
420- * Provides a fallback body when the Graph response text cannot be read.
421- *
422- * @returns Fallback response body message.
423- */
424- ( ) => "unable to read response body"
425- ) ;
404+ httpBody = await patch2Response . text ( ) . catch ( ( ) => "unable to read response body" ) ;
426405 }
427406 }
428407
@@ -445,7 +424,6 @@ class Office365CalendarService implements Calendar {
445424 ) ;
446425 }
447426
448- // PATCH 2 succeeded — use its response for the return value below
449427 response = patch2Response ! ;
450428 } else {
451429 response = await this . fetcher ( eventEndpoint , {
@@ -470,12 +448,8 @@ class Office365CalendarService implements Calendar {
470448 }
471449
472450 /**
473- * Deletes an Office365 event from the same calendar that stored its reference.
474- *
475- * @param uid - Office365 event identifier to delete.
476- * @param _event - Calendar event associated with the deletion.
477- * @param externalCalendarId - Optional Office365 calendar identifier containing the event.
478- * @returns A promise that resolves when Microsoft Graph accepts the delete.
451+ * Selected Outlook calendars require their own Graph delete path; the default-calendar path
452+ * cannot remove events created outside the primary calendar.
479453 */
480454 async deleteEvent ( uid : string , _event : CalendarEvent , externalCalendarId ?: string | null ) : Promise < void > {
481455 try {
@@ -493,12 +467,7 @@ class Office365CalendarService implements Calendar {
493467 }
494468
495469 /**
496- * Builds the Graph event URL for default or explicitly selected calendars.
497- *
498- * @param endpoint - Graph user endpoint for the credential.
499- * @param uid - Office365 event identifier.
500- * @param externalCalendarId - Optional selected calendar identifier.
501- * @returns Microsoft Graph event endpoint for the target calendar.
470+ * Graph separates default-calendar events from explicitly selected calendar events at the URL level.
502471 */
503472 private getEventEndpoint ( endpoint : string , uid : string , externalCalendarId ?: string | null ) {
504473 return externalCalendarId
0 commit comments