makeplane / makeplane/plane

Slack Project Updates: issue webhook ignores project_id, posts to wrong channel

Open
#8,806 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
59.6k
Forks
5.8k
Avg merge
1d 22h
Merged PRs (30d)
49

Description

Bug Description

When multiple Slack Project Update connections are configured (different projects → different Slack channels), the handleIssueWebhook in the silo service sends work item state change notifications to the wrong channel.

Steps to Reproduce

  1. Configure Slack integration with two Project Update mappings:
    • Project A → #channel-a
    • Project B → #channel-b
  2. Create a work item in Project B
  3. Change state to Done

Expected: Notification goes to #channel-b
Actual: Notification goes to #channel-a (the first entity connection returned)

Root Cause

In handleIssueWebhook (silo), the query to find the project entity connection does not filter by project_id:

const [projectEntityConnection] = await integrationConnectionHelper.getWorkspaceEntityConnections({
    workspace_connection_id: workspaceConnection.id,
    entity_type: E_SLACK_ENTITY_TYPE.SLACK_PROJECT_UPDATES
});

This returns ALL SLACK_PROJECT_UPDATES connections and destructures [0] — the first one, regardless of which project the work item belongs to.

Fix

Filter the result by the payload's project:

const allConnections = await integrationConnectionHelper.getWorkspaceEntityConnections({
    workspace_connection_id: workspaceConnection.id,
    entity_type: E_SLACK_ENTITY_TYPE.SLACK_PROJECT_UPDATES
});
const projectEntityConnection = allConnections.find(c => c.project_id === payload.project) || null;

Or better — add project_id as a filter parameter to getWorkspaceEntityConnections.

Additional Context

Note: the handleProjectUpdateWebhook function (the project_update worker) correctly filters by project. The bug is only in the issue worker path.

Version: Plane Commercial, silo service

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the silo service's handleIssueWebhook and compare its connection lookup with handleProjectUpdateWebhook, which already filters by project. Trace payload.project through getWorkspaceEntityConnections; done when issue-worker notifications route each configured project to its matching Slack channel, with coverage for multiple mappings if relevant tests exist.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.