From 63a08155611e794939094474254b5f078e898a8c Mon Sep 17 00:00:00 2001 From: Nishant Bangarwa Date: Sun, 19 Jul 2026 16:00:25 +0530 Subject: [PATCH 1/2] Fix nil pointer dereference when sending alert notifications via non-email notifiers In Rill Developer, admin.GetAlertMetadata returns ErrNotImplemented and adminMeta stays nil. The non-email notifier branch dereferenced adminMeta.RecipientURLs without a nil guard, causing alerts with e.g. Slack notifiers to panic instead of sending. Now the links are left blank when admin metadata is unavailable, matching the email branch's behavior. --- runtime/reconcilers/alert.go | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/runtime/reconcilers/alert.go b/runtime/reconcilers/alert.go index b62ac4d337e3..71418198355f 100644 --- a/runtime/reconcilers/alert.go +++ b/runtime/reconcilers/alert.go @@ -924,16 +924,21 @@ func (r *AlertReconciler) popCurrentExecution(ctx context.Context, self *runtime if err != nil { return err } - urls, ok := adminMeta.RecipientURLs[""] - if !ok { - return fmt.Errorf("failed to get recipient URLs for anon user") - } - openLink, err := addExecutionTime(urls.OpenURL, executionTime) - if err != nil { - return fmt.Errorf("failed to build recipient open url: %w", err) + // Note: adminMeta may not always be available (if outside of cloud). In that case, we leave the links blank (no clickthrough available). + msg.OpenLink = "" + msg.EditLink = "" + if adminMeta != nil && adminMeta.RecipientURLs != nil { + urls, ok := adminMeta.RecipientURLs[""] + if !ok { + return fmt.Errorf("failed to get recipient URLs for anon user") + } + openLink, err := addExecutionTime(urls.OpenURL, executionTime) + if err != nil { + return fmt.Errorf("failed to build recipient open url: %w", err) + } + msg.OpenLink = openLink + msg.EditLink = urls.EditURL } - msg.OpenLink = openLink - msg.EditLink = urls.EditURL start := time.Now() defer func() { totalLatency := time.Since(start).Milliseconds() From 962a69c2cd11750c0960aa884182e9cd513f5e29 Mon Sep 17 00:00:00 2001 From: Nishant Bangarwa Date: Mon, 20 Jul 2026 11:37:44 +0530 Subject: [PATCH 2/2] Reset msg.UnsubscribeLink in non-email notifier branch --- runtime/reconcilers/alert.go | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/reconcilers/alert.go b/runtime/reconcilers/alert.go index 71418198355f..cd44f55ac47c 100644 --- a/runtime/reconcilers/alert.go +++ b/runtime/reconcilers/alert.go @@ -927,6 +927,7 @@ func (r *AlertReconciler) popCurrentExecution(ctx context.Context, self *runtime // Note: adminMeta may not always be available (if outside of cloud). In that case, we leave the links blank (no clickthrough available). msg.OpenLink = "" msg.EditLink = "" + msg.UnsubscribeLink = "" if adminMeta != nil && adminMeta.RecipientURLs != nil { urls, ok := adminMeta.RecipientURLs[""] if !ok {