From 6d21db0a51228bd0768900f6b6543c22097f88a1 Mon Sep 17 00:00:00 2001 From: reachsanjivbhagat-gif Date: Mon, 6 Jul 2026 00:41:19 -0700 Subject: [PATCH] fix(api): fall back to WEB_URL when Redis origin key is missing (#9354) send_email_notification silently dropped email notifications (while still reporting task success) whenever the Redis-cached origin key for an issue was missing due to TTL expiry, a Redis restart, or the activity being queued without an origin. This change replaces the silent early return with a fallback to settings.WEB_URL for link construction, plus a warning log so the condition is observable. Fixes #9354 --- apps/api/plane/bgtasks/email_notification_task.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/api/plane/bgtasks/email_notification_task.py b/apps/api/plane/bgtasks/email_notification_task.py index 5cf1d52af91..aac0f850722 100644 --- a/apps/api/plane/bgtasks/email_notification_task.py +++ b/apps/api/plane/bgtasks/email_notification_task.py @@ -15,6 +15,7 @@ # Django imports from django.utils import timezone +from django.conf import settings # Module imports from plane.db.models import EmailNotificationLog, Issue, User @@ -163,9 +164,12 @@ def send_email_notification(issue_id, notification_data, receiver_id, email_noti ri = redis_instance() base_api = ri.get(str(issue_id)).decode() if ri.get(str(issue_id)) else None - # Skip if base api is not present + # Fall back to the configured web URL if the cached origin is missing if not base_api: - return + logging.getLogger("plane.worker").warning( + f"Redis origin key missing for issue {issue_id}; falling back to WEB_URL for email notification links" + ) + base_api = settings.WEB_URL data = create_payload(notification_data=notification_data)