From e7d4de96be76d8ecac6028d797e81cb61bcb200a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20S=C3=A1nchez?= Date: Thu, 1 Oct 2026 12:25:08 -0600 Subject: [PATCH 1/2] fix[backend](incidents): added tenant id on newly added incident alerts so newly linked alerts dont get a no tenant state --- backend/modules/incidents/repository/incident_alert_pg.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/modules/incidents/repository/incident_alert_pg.go b/backend/modules/incidents/repository/incident_alert_pg.go index d342b57fc..3c1f1d87b 100644 --- a/backend/modules/incidents/repository/incident_alert_pg.go +++ b/backend/modules/incidents/repository/incident_alert_pg.go @@ -27,6 +27,11 @@ func (r *pgIncidentAlertRepository) Save(ctx context.Context, alert *domain.Inci } func (r *pgIncidentAlertRepository) Update(ctx context.Context, alert *domain.IncidentAlert) error { + //add the tenat id if needed, so conflicts ensure new upserted values has it + tid := tenantFromCtx(ctx) + if tid != uuid.Nil { + alert.TenantID = tid + } return scopeTenant(ctx, r.db.WithContext(ctx)).Save(alert).Error } From 331b1be7900a51372b3c3910811f784c5095d92a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20S=C3=A1nchez?= Date: Thu, 1 Oct 2026 12:41:39 -0600 Subject: [PATCH 2/2] fix[backend](incidents): avoided empty incident alert update call --- backend/modules/incidents/repository/incident_alert_pg.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/modules/incidents/repository/incident_alert_pg.go b/backend/modules/incidents/repository/incident_alert_pg.go index 3c1f1d87b..b2bdc892b 100644 --- a/backend/modules/incidents/repository/incident_alert_pg.go +++ b/backend/modules/incidents/repository/incident_alert_pg.go @@ -29,7 +29,7 @@ func (r *pgIncidentAlertRepository) Save(ctx context.Context, alert *domain.Inci func (r *pgIncidentAlertRepository) Update(ctx context.Context, alert *domain.IncidentAlert) error { //add the tenat id if needed, so conflicts ensure new upserted values has it tid := tenantFromCtx(ctx) - if tid != uuid.Nil { + if alert!=nil && tid != uuid.Nil { alert.TenantID = tid } return scopeTenant(ctx, r.db.WithContext(ctx)).Save(alert).Error