Fix Meet programme sync when linking an existing room.
Deploy Ladill Events / deploy (push) Successful in 37s
Deploy Ladill Events / deploy (push) Successful in 37s
PATCH the pre-linked room by UUID so programme_snapshot lands on the room users join instead of creating a duplicate. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -78,23 +78,29 @@ class EventMeetSyncService
|
||||
$settings['panel_discussions'] = true;
|
||||
}
|
||||
|
||||
$roomPayload = [
|
||||
'title' => $title,
|
||||
'description' => trim((string) ($content['description'] ?? '')) ?: null,
|
||||
'type' => $roomType,
|
||||
'scheduled_at' => $scheduledAt,
|
||||
'duration_minutes' => max(15, (int) ($session['duration_minutes'] ?? 60)),
|
||||
'timezone' => config('app.timezone', 'UTC'),
|
||||
'settings' => $settings,
|
||||
'invite_emails' => $inviteEmails,
|
||||
'source' => [
|
||||
'app' => 'events',
|
||||
'entity_type' => 'virtual_session',
|
||||
'entity_id' => $sessionId,
|
||||
'event_id' => (string) $event->id,
|
||||
],
|
||||
];
|
||||
|
||||
$existingRoomUuid = trim((string) ($session['meet_room_uuid'] ?? ''));
|
||||
|
||||
try {
|
||||
$result = $client->upsertRoom([
|
||||
'title' => $title,
|
||||
'description' => trim((string) ($content['description'] ?? '')) ?: null,
|
||||
'type' => $roomType,
|
||||
'scheduled_at' => $scheduledAt,
|
||||
'duration_minutes' => max(15, (int) ($session['duration_minutes'] ?? 60)),
|
||||
'timezone' => config('app.timezone', 'UTC'),
|
||||
'settings' => $settings,
|
||||
'invite_emails' => $inviteEmails,
|
||||
'source' => [
|
||||
'app' => 'events',
|
||||
'entity_type' => 'virtual_session',
|
||||
'entity_id' => $sessionId,
|
||||
'event_id' => (string) $event->id,
|
||||
],
|
||||
]);
|
||||
$result = $existingRoomUuid !== ''
|
||||
? $client->updateRoom($existingRoomUuid, $roomPayload)
|
||||
: $client->upsertRoom($roomPayload);
|
||||
} catch (\Throwable $e) {
|
||||
Log::warning('Events Meet sync failed', [
|
||||
'event_id' => $event->id,
|
||||
|
||||
Reference in New Issue
Block a user