fix(replay-vision): select Slack workspace for alerts - #106575
Indira-kumar wants to merge 5 commits into
Conversation
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: PostHog/posthog/.coderabbit.yaml Review profile: QUIET Plan: Enterprise Run ID: 📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review. 📝 WalkthroughWalkthroughScanner alerts now track the selected Slack workspace by integration ID. The component loads channels for the selected integration and passes workspace changes to the alert logic. The logic uses the resolved integration to validate and stage Slack notifications. A test covers default selection, switching workspaces, clearing the channel value, and staging a notification. Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The reviewed workspace-selection and destination behavior has no identified issue requiring a fix before merge. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The editor now supports alerts in a second connected Slack workspace. The reviewed flow clears the old channel when workspaces change and saves the selected workspace with its channel. No introduced security issue was established, but server-side checks for those identifiers remain unverified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Hardening Proposals
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
| actions.addPendingNotification({ | ||
| type: VISION_ALERT_NOTIFICATION_TYPE_SLACK, | ||
| slackWorkspaceId: values.firstSlackIntegration.id, | ||
| slackWorkspaceId: values.selectedSlackIntegration.id, |
There was a problem hiding this comment.
🤖 Agent-drafted, reviewed by Tue.
Small follow-on: groupVisionAlertDestinations in scannerAlertUtils.ts groups Slack destinations by channel only. With a workspace picker, two workspaces can share a channel ID (Slack Connect), so they'd show up as one row. Adding the workspace to that key should fix it.
There was a problem hiding this comment.
While testing, I noticed that saved destinations still display only “Slack” after reopening the alert. I’ve tracked that separately in #107955 so this PR can remain focused.
|
|

Problem
Changes
Screenshots
Currently selected workspace A:



Switched to workspace B:
Selected channels from both workspaces:
How did you test this code?
hogli test products/replay_vision/frontend/replay_scanners/scannerAlertNotificationLogic.test.tspassed. The test verifies that workspace 2 is staged in the Slack notification payload.pnpm --filter=@posthog/frontend typescript:checkpassed.hogli ci:preflight --strict --against upstream/masterreported zero strict failures.Release status
Automatic notifications
Docs update
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Agent: Codex, GPT-5
upstream/masterand its focused regression test was added to cover the selected workspace payload./running-ci-preflight,/writing-pr-descriptions,/qa-frontend,/run-posthog, and/reviewing-with-coderabbit.