🐛 Bug: send_email_notification silently drops emails (task reports success) when the Redis origin key is missing
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 59.6k
- Forks
- 5.8k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 49
Description
Is there an existing issue for this?
- I have searched the existing issues
Current behavior
send_email_notification in apps/api/plane/bgtasks/email_notification_task.py silently drops all email notifications for an issue whenever its Redis origin key is missing:
base_api = ri.get(str(issue_id)).decode() if ri.get(str(issue_id)) else None
...
if not base_api:
return
The early return emits no log and raises no exception, so the Celery task reports success while sending nothing.
The key is only written by issue_activity (ri.set(str(issue_id), origin, ex=600)) when an origin kwarg is passed, with a 600s TTL. So the key is absent — and emails are silently dropped — whenever:
- Redis restarts or evicts the key between the activity and the (debounced/delayed) email task,
- more than 10 minutes elapse before the email task reads it, or
- the activity was queued without
originat all (the public REST API paths do this — see #9306, which this bug also masks: the in-app notification bug there is at least visible, but the email half fails with a "successful" task).
Expected behavior
If the cached origin is unavailable, the task should fall back to the configured WEB_URL (settings) for link construction — and at minimum log a WARNING — instead of silently discarding the notification batch while reporting success.
Suggested fix
In send_email_notification, replace the bare return with a fallback to settings.WEB_URL plus a log.warning when the Redis key is missing. (Two small changes; happy to detail.)
Steps to reproduce
- SMTP configured; user B has email notifications enabled.
- User A assigns user B to an issue in the web UI (this queues
issue_activitywithorigin, then the debounced email task). - Before the email task runs, restart/flush Redis (or wait past the 600s TTL under a delayed worker).
- Email task runs, returns early, reports SUCCESS; user B receives nothing; no log line indicates a drop.
Environment
Production
Variant
Self-hosted
Version
v1.3.1 (Community); code path unchanged on current default branch as of 2026-06-19
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in apps/api/plane/bgtasks/email_notification_task.py at send_email_notification and inspect the Redis origin lookup and early return. Check issue_activity for how the 600-second origin key is written. Done means missing origin uses settings.WEB_URL, emits a WARNING, and does not silently report a dropped email batch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, redis
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100