Repository navigation
feat(conversations): Store visibility on every Conversation - #4335
Conversation
Access read visibility from the root's shared Destination row. Store a public or private value on each root instead, set from its Destination and moved when a live signal changes it. Access, search, purge, Inbox, locations, and people reports read the root Conversation. Null is private. Co-Authored-By: David Cramer <[email protected]>
Resolve the private Spaces overlap, regenerate the visibility migrations after main's, and keep each root's visibility fixed once it is known. Co-Authored-By: David Cramer <[email protected]>
Co-Authored-By: David Cramer <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This comment has been minimized.
This comment has been minimized.
A Space move into a private Space makes its root private again, through one helper that changes a root and its tree. Slack channel changes still leave a root's visibility as it is. Co-Authored-By: David Cramer <[email protected]>
|
Okay, so every conversation row should have this visibility attribute on its schema, right? And any API call accessing, any conversation data should be able to leverage that as part of it. And all of this should be well abstracted so that we're not re-implementing checks all over the place with different conditions |
|
6 screenshot changes — 6 changed · 0 added · 0 removed Review screenshots in Frameshift |
A child copies its root's visibility when it is created, and setConversationVisibility changes the whole tree in one statement, so each query checks the row it reads. isPublicConversation is the one query predicate. Two ast-grep rules keep writes in privacy.ts and keep queries on the predicate. Co-Authored-By: David Cramer <[email protected]>
|
Yes, as of bfb1a98.
A root whose visibility isn't known yet still fills once from its first known value, and that fill now reaches its whole tree. |
Co-Authored-By: David Cramer <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bfb1a98. Configure here.
The first fill of a tree now takes the same Destination lock as setConversationVisibility, so a child created at the same time cannot keep a missing value. A root with no Destination reads its stored visibility instead of private.
|
eli5 what changes? did we not store this on every row before? only roots? |
|
Before this PR, no Conversation row stored visibility, not even roots. To decide public or private, the code looked up the root's Slack channel or DM row ( What changes:
What stays the same: private still means Participants only, no memory writes, no message search, and redacted telemetry. Those gates now read the column instead of the Destination. |
A root keeps the visibility it was created with, so a channel that went public can still hold private roots. The location directory now groups by the root's visibility and adds only public roots to a named location.
|
was that the same with web-based conversations? |
|
Yes, same mechanism. Before this PR, a web Conversation also read its visibility from a Destination row. The difference is that each web Conversation got its own Destination (provider
So web visibility was already per Conversation, just stored on a side row. Now it lives on the Conversation row itself, the same as Slack. |
|
Directionally, this means destination visibility will not be a huge concern. Like, yeah, it might matter for Slack, but web, clearly, that's not a thing. And so that'll be a future cleanup pass here |
…4372) Members can now rename a Space and change its description from the dashboard. The API already supported this (`PATCH /api/spaces/:spaceId`, member-only), but no UI used it. - The create dialog is now `SpaceFormDialog`. With a `space` it edits that Space, prefilled, and Save stays disabled until something changes. - "Edit Space" is in the Space menu in the header. Each Space in the pane now has a context menu (right-click or long press) with the same rows: Edit, Archive/Restore, and Leave. Both menus share `useSpaceActions`. - After a save, the dashboard reads Conversation feeds and the details of Conversations in that Space again, so "Space: …" labels and the Lead show the new name. The edit form has no visibility field. `design/spaces.md` says a Space's visibility is set when it is created and never changes, and the API refuses a visibility change. Making a public Space private would also change which Conversations people can read (#4335). That needs a design change first. The Space tile shows the name's initial, so a rename changes the tile. After #4365 merges, it shows first and last initials. <!-- junior-request-attribution:start --> via @dcramer. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:local%3Aweb%3Afc258573947c28ac60459295 --> -- [View Session](https://junior-prod.sentry.dev/conversations/local%3Aweb%3Afc258573947c28ac60459295) [[Sentry]](https://sentry.sentry.io/explore/conversations/local%3Aweb%3Afc258573947c28ac60459295/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: David Cramer <[email protected]>
Builds on #4335. This makes a private Conversation first-class: its Participants are an explicit list that people manage. Rules: - **Public** Conversations don't change. You join one by posting, with no join step. Anyone who can post may Invite, and Invite gives no access. - **Private** dashboard Conversations: any Participant may Invite a person, and that shares the Conversation. A mention in a Message adds nobody, so sharing a private Conversation always takes an explicit Invite. - **Leave replaces Unsubscribe.** A person can Leave any Conversation they are in (`POST /api/conversations/:id/leave`, also the `leaveConversation` MCP tool). Nobody removes another person. - Leave takes the Conversation out of your feed, and Join puts it back. - In a private dashboard Conversation, Leave also ends your access, after a confirm dialog. Only someone still in it can Invite you back. - A public Conversation stays readable after you Leave, so you can find it and Join again. - When the last subscriber leaves, the Conversation is archived for everyone. - **Slack-backed private Conversations** follow their Slack channel, so they refuse Invite, and Leave only takes them out of your feed. A follow-up PR checks channel membership live (#2679). - **Private Spaces** keep owning their audience. They also refuse Invite, and Leave only takes them out of your feed. The rules live in one place, `canInviteToConversation` and `leaveEndsAccess` in `api/conversations/access.ts`. The detail reports them as `canInvite` and `leaveEndsAccess`. The dashboard uses those flags for the mention card's Invite and for the Leave/Join menu item, so it no longer checks visibility itself. After a Leave that ends access, the dashboard replaces the page in history and drops the cached detail, so Back can't show the transcript again. The subscription API stays for Join and for the iOS app. Docs: `policies/conversation-access.md`, `TERMINOLOGY.md` (Invite and Leave), and the subscription contract comment. Refs #2380 <!-- junior-request-attribution:start --> via @dcramer. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A8e2a5d8f15a579ed6182efe354376b40 --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3A8e2a5d8f15a579ed6182efe354376b40) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A8e2a5d8f15a579ed6182efe354376b40/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: David Cramer <[email protected]>

Access read a Conversation's visibility from its root's shared Destination row. Now every Conversation row stores
publicorprivateonjunior_conversations.visibility. Access, search, message search, Inbox access, purge, location stats, and people reports read it from the row they already have. Public: anyone reads. Private: only the root's Participants (junior_conversation_participants) read. Memory writes,searchConversationMessages, and payload redaction stay off for private.This supersedes the four-tier model in #2380 and is the base for #2679.
Rules:
setConversationVisibility(sql/privacy.ts) is the one way to switch a root and its whole tree between public and private. A move into a private Space uses it.isPublicConversation. Two ast-grep rules keep visibility writes inprivacy.tsand keep raw comparisons on the column out of queries.Rollout: the backfill copies each Destination's value to its root, then each root's value to its children (unknown stays null). Rows that an old deploy writes during the rollout stay null (private) until their next write with a known Destination.
via @dcramer.
--
View Session [Sentry]