Skip to content

feat(conversations): Slack-backed private Conversations follow channel membership - #4373

Closed
sentry-junior[bot] wants to merge 4 commits into
mainfrom
feat/slack-private-membership
Closed

sentry-junior[bot] wants to merge 4 commits into
mainfrom
feat/slack-private-membership

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

A private Conversation in a Slack channel, DM, or group DM now follows the people who are in it now, not the people who once posted there.

  • A person removed from the channel loses access, even if they posted before.
  • A channel member who never posted can open the Conversation by link, read it, and post. They aren't added to anyone's feed until they post.
  • Nobody outside the channel can get access. Invite on a private Conversation is still refused.
  • Visibility doesn't change. A channel that changes type keeps the visibility the Conversation already stored.
  • Private Spaces keep their own membership rule. Inbox items keep the Participant rule.

How it works:

  • api/conversations/slack-audience.ts asks Slack (conversations.members, through the bot's installation) whether any of the viewer's linked Slack accounts in that workspace is in the channel.
  • Each answer is shared across instances for 60 seconds, so a removed person loses access within a minute.
  • A failed Slack check denies access for that request only and logs conversation_access.slack_membership.unavailable.
  • conversationAccessFromRows uses the answer for Slack-backed private rows in the detail, the feed, and posting (canAddConversationMessages).

Policy: one line in policies/conversation-access.md.

Addresses #2679

via @dcramer.

--

View Session [Sentry]

…l membership

A private Conversation in a Slack channel, DM, or group DM now follows who is
in it now, checked live with conversations.members. A person removed from the
channel loses access, and a member who never posted can read and post.
Answers are shared for 60 seconds, and a failed check denies access.

Refs #2679

Co-Authored-By: David Cramer <[email protected]>
@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 25, 2026 11:47pm UTC

Request Review

…nstallation

Load the Slack app lazily so access checks don't pull it into every
importer, and answer conversations.members in the eval Slack fixture.

Refs #2679

Co-Authored-By: David Cramer <[email protected]>
@sentry-junior
sentry-junior Bot marked this pull request as ready for review November 25, 2026 23:11
@sentry-junior
sentry-junior Bot requested a review from dcramer November 25, 2026 23:11
@github-actions github-actions Bot added the risk: high PR risk score: high label Nov 25, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0a4eabb. Configure here.

adapter: getProductionSlackAdapter(),
installation: { teamId },
task: () => isConversationMember(channelId, userId),
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Large channels deny current members

Medium Severity

Access now treats isConversationMember as the source of truth, but that helper only walks five conversations.members pages (5000 users) and returns false when the viewer is later in the list. A current member of a large private channel is then denied the Conversation, and that false is cached for 60 seconds.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0a4eabb. Configure here.

@dcramer

dcramer commented Nov 25, 2026

Copy link
Copy Markdown
Member

Oh, this is a nice safety. I would prefer to not have to query Slack all the time to answer these kinds of questions, especially as we're moving this into a many to many table. That means really the slack events somehow need to influence the relationships in the table, and then there probably needs to be a function that can sync it if it gets out of sync or something along those lines

@sentry-junior

sentry-junior Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Makes sense. Here's the shape I'd build:

  • Slack's member_joined_channel and member_left_channel events (plus channel_left / group_left for the bot) add or remove Participant rows for that channel's private Conversations. A row added by a join stays unsubscribed, so it doesn't push the Conversation into anyone's feed.
  • Access reads only the rows. Nothing calls Slack on a read.
  • resyncSlackChannelParticipants(channel) pages conversations.members and fixes the rows. It runs when the bot joins a channel, and on demand when the rows drift.

Should I rework this PR to that, or merge this one as-is and do the event-driven version next?

…mbership

# Conflicts:
#	packages/junior/tests/integration/api/conversations/subscription.test.ts
#	policies/conversation-access.md
@sentry-junior

sentry-junior Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Closing without merging. The gap is small, and asking Slack on every read is the wrong shape. Tracking it in #2679.

@github-actions

Copy link
Copy Markdown
Contributor

1 screenshot change — 1 changed · 0 added · 0 removed

Review screenshots in Frameshift

System Cache Missing · Desktop
System Cache Missing · Desktop
Changed

This branch was successfully deployed

1 active deployment
Preview – junior-docs — c7c09d53 Deployed Nov 25, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant