-
Notifications
You must be signed in to change notification settings - Fork 2.9k
[WEB-5346]: refactor notifications to separate modules based on entities #8092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: preview
Are you sure you want to change the base?
Changes from all commits
60cab0c
bec90c2
d1d6282
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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, | ||
|
|
@@ -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: | ||
|
|
@@ -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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Restore async task import after handler rename.
🤖 Prompt for AI Agents |
||
|
|
||
| return | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function
process_issue_notificationsis 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: