From b71df9fc1893b4e7b725e86d343312efae5e554e Mon Sep 17 00:00:00 2001 From: Oliver Kieselbach Date: Fri, 19 Jun 2026 10:54:43 +0200 Subject: [PATCH] fix(backend): correct webhook session URL to /sessions/{id} Webhook notifications built /session/{tenantId}/{sessionId}, which is a dead route (404). The web app route is /sessions/{sessionId} (plural, single segment); tenant is resolved from the session, not the path. Fixes broken "Open session" links in enrollment-started and success/failure notifications. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../Functions/Ingest/IngestEventsFunction.Processing.cs | 2 +- .../Functions/Sessions/RegisterSessionFunction.cs | 2 +- .../Services/EventIngestProcessor.Notifications.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Backend/AutopilotMonitor.Functions/Functions/Ingest/IngestEventsFunction.Processing.cs b/src/Backend/AutopilotMonitor.Functions/Functions/Ingest/IngestEventsFunction.Processing.cs index 1c874557..51639865 100644 --- a/src/Backend/AutopilotMonitor.Functions/Functions/Ingest/IngestEventsFunction.Processing.cs +++ b/src/Backend/AutopilotMonitor.Functions/Functions/Ingest/IngestEventsFunction.Processing.cs @@ -871,7 +871,7 @@ namespace AutopilotMonitor.Functions.Functions.Ingest var providerType = (WebhookProviderType)providerTypeInt; var sessionUrl = updatedSession != null - ? $"https://portal.autopilotmonitor.com/session/{request.TenantId}/{request.SessionId}" + ? $"https://portal.autopilotmonitor.com/sessions/{request.SessionId}" : null; // Enrollment completion/failure notification diff --git a/src/Backend/AutopilotMonitor.Functions/Functions/Sessions/RegisterSessionFunction.cs b/src/Backend/AutopilotMonitor.Functions/Functions/Sessions/RegisterSessionFunction.cs index 319a6732..a9ad5fbe 100644 --- a/src/Backend/AutopilotMonitor.Functions/Functions/Sessions/RegisterSessionFunction.cs +++ b/src/Backend/AutopilotMonitor.Functions/Functions/Sessions/RegisterSessionFunction.cs @@ -251,7 +251,7 @@ namespace AutopilotMonitor.Functions.Functions.Sessions if (string.IsNullOrEmpty(webhookUrl) || providerTypeInt == 0) return; - var sessionUrl = $"https://portal.autopilotmonitor.com/session/{tenantId}/{sessionId}"; + var sessionUrl = $"https://portal.autopilotmonitor.com/sessions/{sessionId}"; var alert = NotificationAlertBuilder.BuildEnrollmentStartedAlert( session.DeviceName, session.SerialNumber, diff --git a/src/Backend/AutopilotMonitor.Functions/Services/EventIngestProcessor.Notifications.cs b/src/Backend/AutopilotMonitor.Functions/Services/EventIngestProcessor.Notifications.cs index cb745a0a..5ab4c2b8 100644 --- a/src/Backend/AutopilotMonitor.Functions/Services/EventIngestProcessor.Notifications.cs +++ b/src/Backend/AutopilotMonitor.Functions/Services/EventIngestProcessor.Notifications.cs @@ -28,7 +28,7 @@ namespace AutopilotMonitor.Functions.Services var providerType = (WebhookProviderType)providerTypeInt; var sessionUrl = updatedSession != null - ? $"https://portal.autopilotmonitor.com/session/{request.TenantId}/{request.SessionId}" + ? $"https://portal.autopilotmonitor.com/sessions/{request.SessionId}" : null; if (statusTransitioned && (c.CompletionEvent != null || c.FailureEvent != null))