Skip to content

fix: dispatch notifications for comment, link, and delete endpoints in the external API#9448

Open
stella-nova wants to merge 1 commit into
makeplane:previewfrom
stella-nova:fix/api-v1-notifications-comments-links-delete
Open

fix: dispatch notifications for comment, link, and delete endpoints in the external API#9448
stella-nova wants to merge 1 commit into
makeplane:previewfrom
stella-nova:fix/api-v1-notifications-comments-links-delete

Conversation

@stella-nova

@stella-nova stella-nova commented Jul 20, 2026

Copy link
Copy Markdown

Description

Comment create/update/delete, link create/update/delete, and work item delete through the external REST API (/api/v1/...) create activities but never notify assignees and subscribers — neither in-app nor by email. issue_activity is dispatched without notification=True (the parameter defaults to False in apps/api/plane/bgtasks/issue_activities_task.py), so notifications.delay(...) never runs. The web app views (apps/api/plane/app/views/issue/base.py, comment.py, link.py) pass notification=True and origin for the same actions, and in the same external API file the attachment and relation endpoints already pass it.

This PR passes notification=True and origin=base_host(request=request, is_app=True) on the remaining seven issue_activity.delay(...) calls in apps/api/plane/api/views/issue.py (comment create/update/delete, link create/update/delete, work item delete), mirroring the web app views. It complements #9307, which fixed issue create/update in the same file.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Test Scenarios

Contract tests added to plane/tests/contract/api/test_issue_notifications.py following the conventions introduced there: one test per endpoint asserting that the dispatched activity carries notification=True (7 new tests). Ran the full file against PostgreSQL/Redis/RabbitMQ services: 10 passed. Verified red/green: on the unpatched views exactly the 7 new tests fail. ruff check clean.

Also verified end-to-end on a self-hosted v1.3.1 instance carrying this change as a patch: an API-token comment on a subscribed work item produces the in-app notification, the email notification log entry, and the batched email.

References

Covers #7846. Complements #9306 / #9307.

Summary by CodeRabbit

  • New Features

    • Issue comments, links, and deletions now generate notifications through the external API.
    • Notifications are triggered when comments or links are created, updated, or deleted.
  • Tests

    • Added coverage verifying notification events for issue, comment, and link changes.

…nts in external API

Comment create/update/delete, link create/update/delete, and work item delete
through the external REST API (/api/v1/...) created activities but never
notified assignees and subscribers - issue_activity was dispatched without
notification=True (defaults to False), so notifications.delay() never ran.
The web app views pass notification=True and origin for the same actions.

Pass notification=True and origin=base_host(request=request, is_app=True) on
these seven issue_activity.delay() calls, mirroring the web app views and the
attachment/relation endpoints in the same file. Complements makeplane#9307, which fixed
issue create/update. Covers makeplane#7846.

Contract tests added following test_issue_notifications.py conventions.
@CLAassistant

CLAassistant commented Jul 20, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 531f2f62-fc74-4430-b5f3-b50e2458e667

📥 Commits

Reviewing files that changed from the base of the PR and between 7cef741 and 8c9e923.

📒 Files selected for processing (2)
  • apps/api/plane/api/views/issue.py
  • apps/api/plane/tests/contract/api/test_issue_notifications.py

📝 Walkthrough

Walkthrough

Changes

REST issue, comment, and link mutation endpoints now pass notification=True and an app-derived origin to issue_activity.delay. Contract tests cover all create, update, and delete activity events.

REST activity notifications

Layer / File(s) Summary
Add notification metadata to REST dispatches
apps/api/plane/api/views/issue.py
Issue deletion and comment/link create, update, and delete handlers include notification and origin metadata in activity dispatches.
Verify notifying activity contracts
apps/api/plane/tests/contract/api/test_issue_notifications.py
Fixtures and contract tests verify endpoint statuses, activity types, and notification=True for comment, link, and issue deletion operations.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • makeplane/plane#9307: Updates related REST issue activity dispatches for issue creation and updates.

Suggested reviewers: dheeru0198, pablohashescobar

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: adding notifications to external API issue activity dispatches.
Description check ✅ Passed The PR description follows the template with description, type, tests, and references; screenshots are optional.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants