Skip to content

fix(supergroups): Strip inaccessible groups from by-group response - #129217

Merged
michelletran-sentry merged 2 commits into
masterfrom
fix/supergroups-filter-inaccessible-groups
Oct 29, 2026
Merged

michelletran-sentry merged 2 commits into
masterfrom
fix/supergroups-filter-inaccessible-groups

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

OrganizationSupergroupsByGroupEndpoint validates the requested group_ids against the caller's projects. But Seer returns every group in each matching supergroup, and those came back as-is. Unless a status filter was applied below the fan-out threshold, the response could include group IDs, project IDs and assignees from projects the caller can't access.

Right after the Seer call, one values_list("id", "status") query over the returned group IDs, limited to the caller's projects, drives both filters. Each supergroup's group_ids and project_ids are trimmed to what the caller can access, and supergroups left empty are dropped. This runs before the threshold check, so the over-threshold path is covered too. The status filter reuses the same statuses instead of running a second get_group_list lookup, so the endpoint still makes one group query after Seer.

test_skips_fanout_over_threshold used 100 made-up group IDs to trip the threshold. Those IDs are now filtered out, so the test patches the threshold to 1 and uses real groups instead.

Open question for owners: the supergroup title and summary come from Seer and may reflect issues in projects the caller can't see. This PR doesn't change them.

via Michelle Tran.

--

View Junior Session [Sentry]

Seer returns every group in a supergroup, including groups in projects the
caller cannot access. Filter group_ids and project_ids to the caller's
projects before the status, threshold, and assignee handling, and drop
supergroups that end up empty.

Co-Authored-By: Michelle Tran <[email protected]>
@sentry-junior
sentry-junior Bot requested a review from a team as a code owner October 29, 2026 17:37
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 29, 2026
@michelletran-sentry
michelletran-sentry marked this pull request as draft October 29, 2026 17:41
The access filter and the status filter each queried the same group ids.
Fetch id and status once and run both filters from that result.

Co-Authored-By: Michelle Tran <[email protected]>
@michelletran-sentry
michelletran-sentry marked this pull request as ready for review October 29, 2026 19:46

@cvxluo cvxluo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i think supergroups are limited to open team membership only orgs, so i don't think there's any impact here? either way fix looks good just in case things change in the future

@michelletran-sentry
michelletran-sentry merged commit 22dc1b1 into master Oct 29, 2026
74 checks passed
@michelletran-sentry
michelletran-sentry deleted the fix/supergroups-filter-inaccessible-groups branch October 29, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants