diff --git a/backend/modules/incidents/repository/incident_alert_pg.go b/backend/modules/incidents/repository/incident_alert_pg.go index d342b57fc..b2bdc892b 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 alert!=nil && tid != uuid.Nil { + alert.TenantID = tid + } return scopeTenant(ctx, r.db.WithContext(ctx)).Save(alert).Error }