-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
- Configure Slack integration with two Project Update mappings:
- Project A → #channel-a
- Project B → #channel-b
- Create a work item in Project B
- 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