Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions runtime/reconcilers/alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -924,16 +924,22 @@ 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 = ""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: may be reset msg.UnsubscribeLink as well defensively and for consistency

msg.UnsubscribeLink = ""
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()
Expand Down
Loading