@@ -549,6 +549,7 @@ export default class EventManager {
549549 userId : true ,
550550 attendees : true ,
551551 location : true ,
552+ endTime : true ,
552553 references : {
553554 where : {
554555 deleted : null ,
@@ -584,8 +585,18 @@ export default class EventManager {
584585 const results : Array < EventResult < Event > > = [ ] ;
585586 const updatedBookingReferences : Array < PartialReference > = [ ] ;
586587 const isLocationChanged = ! ! evt . location && ! ! booking . location && evt . location !== booking . location ;
588+
589+ let isDailyVideoRoomExpired = false ;
590+
591+ if ( evt . location === "integrations:daily" ) {
592+ const originalBookingEndTime = new Date ( booking . endTime ) ;
593+ const roomExpiryTime = new Date ( originalBookingEndTime . getTime ( ) + 14 * 24 * 60 * 60 * 1000 ) ;
594+ const now = new Date ( ) ;
595+ isDailyVideoRoomExpired = now > roomExpiryTime ;
596+ }
597+
587598 const shouldUpdateBookingReferences =
588- ! ! changedOrganizer || isLocationChanged || ! ! isBookingRequestedReschedule ;
599+ ! ! changedOrganizer || isLocationChanged || ! ! isBookingRequestedReschedule || isDailyVideoRoomExpired ;
589600
590601 if ( evt . requiresConfirmation ) {
591602 log . debug ( "RescheduleRequiresConfirmation: Deleting Event and Meeting for previous booking" ) ;
@@ -609,7 +620,7 @@ export default class EventManager {
609620 updatedBookingReferences . push ( ...createdEvent . referencesToCreate ) ;
610621 } else {
611622 // If the reschedule doesn't require confirmation, we can "update" the events and meetings to new time.
612- if ( isLocationChanged || isBookingRequestedReschedule ) {
623+ if ( isLocationChanged || isBookingRequestedReschedule || isDailyVideoRoomExpired ) {
613624 const updatedLocation = await this . updateLocation ( evt , booking ) ;
614625 results . push ( ...updatedLocation . results ) ;
615626 updatedBookingReferences . push ( ...updatedLocation . referencesToCreate ) ;
0 commit comments