Fix Events mail calendar sync when virtual sessions lack ids.
Deploy Ladill Events / deploy (push) Successful in 52s

Generate session ids before upserting and fall back to the main event date so August events reach Mail calendar.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-04 12:27:48 +00:00
co-authored by Cursor
parent d25682bc6c
commit a00f032b5b
3 changed files with 38 additions and 3 deletions
@@ -9,6 +9,7 @@ use App\Services\Integrations\MailCalendarClient;
use Carbon\CarbonInterface;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Str;
class EventMailCalendarSyncService
{
@@ -91,7 +92,9 @@ class EventMailCalendarSyncService
}
}
if ($format === 'hybrid' && filled($content['starts_at'] ?? null)) {
if ($entries === [] && filled($content['starts_at'] ?? null)) {
$entries[] = $this->mainEventEntry($event, $content);
} elseif ($format === 'hybrid' && filled($content['starts_at'] ?? null)) {
$entries[] = $this->mainEventEntry($event, $content, ' (in person)');
}
@@ -114,7 +117,7 @@ class EventMailCalendarSyncService
{
$sessionId = trim((string) ($session['id'] ?? ''));
if ($sessionId === '') {
return null;
$sessionId = 'vs-'.Str::lower(Str::random(12));
}
$starts = $this->parseDate($session['scheduled_at'] ?? $content['starts_at'] ?? null);
+6 -1
View File
@@ -4,6 +4,7 @@ namespace App\Services\Qr;
use App\Models\QrCode;
use App\Support\Qr\QrDateFormatter;
use Illuminate\Support\Str;
use App\Support\Qr\QrTypeCatalog;
use Illuminate\Http\UploadedFile;
use RuntimeException;
@@ -336,6 +337,10 @@ class QrPayloadValidator
}
$id = trim((string) ($session['id'] ?? ''));
if ($id === '') {
$id = 'vs-'.Str::lower(Str::random(12));
}
$roomType = in_array($session['meet_room_type'] ?? '', ['town_hall', 'webinar'], true)
? (string) $session['meet_room_type']
: 'town_hall';
@@ -349,7 +354,7 @@ class QrPayloadValidator
}
$normalized[] = [
'id' => $id !== '' ? mb_substr($id, 0, 64) : null,
'id' => mb_substr($id, 0, 64),
'title' => mb_substr($title, 0, 120),
'meet_room_type' => $roomType,
'scheduled_at' => QrDateFormatter::normalize((string) ($session['scheduled_at'] ?? '')),