fix(replay): use org members endpoint for replay access selector#120585
fix(replay): use org members endpoint for replay access selector#120585DominikB2014 wants to merge 1 commit into
Conversation
The Replay Access Members selector in Org General Settings fetched from
/organizations/{org}/users/ (OrganizationUsersEndpoint), which only
returns members who share a project the requester can access and filters
those projects by the requester's project *membership* for non-superusers.
An owner/manager not on the relevant teams therefore got an empty member
list (appearing stuck on loading), while superusers saw every member --
which is why the issue only reproduced for regular admins.
Swap to the existing memberUsersQueryOptions helper, which hits
/organizations/{org}/members/ and lists all org members regardless of the
requester's team membership.
Fixes REPLAY-947
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1dfe2b0. Configure here.
| }); | ||
| const {data: members = [], isPending: fetching} = useQuery( | ||
| memberUsersQueryOptions({orgSlug: organization.slug}) | ||
| ); |
There was a problem hiding this comment.
Member list truncated by pagination
Medium Severity
memberUsersQueryOptions hits the paginated /members/ endpoint and only loads the first page (default 100), with no further pages or server-side search. Orgs larger than that cannot select every member for replayAccessMembers, so some people stay missing from the access list.
Reviewed by Cursor Bugbot for commit 1dfe2b0. Configure here.


Fixes REPLAY-947.
Problem
When "Restrict Replay Access" is enabled in Settings → General, the Replay Access Members selector was stuck loading / showed no members for regular org owners and managers. It only worked for superusers, which is why the reporter couldn't reproduce it as a superuser.
Root cause
The field fetched its member list from
GET /organizations/{org}/users/(OrganizationUsersEndpoint). That endpoint doesn't return org members — it returns users who share a project the requester can access, and it builds that project list viaget_projects(), which for non-superusers filters by the requester's project membership (has_project_membership).An owner/manager who isn't on the relevant teams therefore resolves to zero projects → zero members → an empty selector. Superusers hit the
has_project_accessbranch instead and see every member.Fix
Swap the selector to the existing
memberUsersQueryOptionshelper, which hitsGET /organizations/{org}/members/and lists all org members regardless of the requester's team membership. Spec mocks updated from/users/to/members/accordingly.