Skip to content
Open
Show file tree
Hide file tree
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
13 changes: 6 additions & 7 deletions apps/api/plane/bgtasks/issue_activities_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

# Module imports
from plane.app.serializers import IssueActivitySerializer
from plane.bgtasks.notification_task import notifications
from plane.db.models import (
CommentReaction,
Cycle,
Expand All @@ -32,7 +31,7 @@
from plane.utils.exception_logger import log_exception
from plane.utils.issue_relation_mapper import get_inverse_relation
from plane.utils.uuid import is_valid_uuid

from plane.bgtasks.notification_task import process_issue_notifications

def extract_ids(data: dict | None, primary_key: str, fallback_key: str) -> set[str]:
if not data:
Expand Down Expand Up @@ -1580,18 +1579,18 @@ def issue_activity(
issue_activities_created = IssueActivity.objects.bulk_create(issue_activities)

if notification:
notifications.delay(
type=type,
process_issue_notifications(
issue_id=issue_id,
actor_id=actor_id,
project_id=project_id,
subscriber=subscriber,
issue_activities_created=json.dumps(
actor_id=actor_id,
activities_data=json.dumps(
IssueActivitySerializer(issue_activities_created, many=True).data,
cls=DjangoJSONEncoder,
),
requested_data=requested_data,
current_instance=current_instance,
subscriber=subscriber,
notification_type=type,
)
Comment on lines +1582 to 1594
Copy link

Copilot AI Nov 10, 2025

Choose a reason for hiding this comment

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

The function process_issue_notifications is missing the .delay() call which is required for Celery async task execution. Without .delay(), the task will execute synchronously, blocking the main thread.

Change:

process_issue_notifications(

To:

process_issue_notifications.delay(

Copilot uses AI. Check for mistakes.
Comment on lines +1582 to 1594
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Restore async task import after handler rename.

from plane.utils.notifications import IssueNotificationHandler now resolves to nothing because the package only exports NotificationContext and WorkItemNotificationHandler. The import here will raise ImportError, and the task never runs. Pick one: either re-export IssueNotificationHandler from the package, or switch this call site to import the new class (e.g. from plane.utils.notifications import WorkItemNotificationHandler as IssueNotificationHandler). Until then, every notification-triggering activity fails immediately.

🤖 Prompt for AI Agents
In apps/api/plane/bgtasks/issue_activities_task.py around lines 1582 to 1594,
the code assumes IssueNotificationHandler is exported from
plane.utils.notifications but that symbol no longer exists (package now exposes
NotificationContext and WorkItemNotificationHandler), causing ImportError and
preventing the task from running; update the import at the top of this file to
either re-export the old name or directly import the new handler (e.g. from
plane.utils.notifications import WorkItemNotificationHandler as
IssueNotificationHandler) and adjust any references accordingly so the task uses
the available WorkItemNotificationHandler (or re-export IssueNotificationHandler
in the package if you prefer keeping the old name).


return
Expand Down
Loading
Loading