Skip to content

fix(replay): use org members endpoint for replay access selector#120585

Draft
DominikB2014 wants to merge 1 commit into
masterfrom
claude/replay-members-selector-loading-b967ec
Draft

fix(replay): use org members endpoint for replay access selector#120585
DominikB2014 wants to merge 1 commit into
masterfrom
claude/replay-members-selector-loading-b967ec

Conversation

@DominikB2014

Copy link
Copy Markdown
Contributor

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 via get_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_access branch instead and see every member.

Fix

Swap the selector to the existing memberUsersQueryOptions helper, which hits GET /organizations/{org}/members/ and lists all org members regardless of the requester's team membership. Spec mocks updated from /users/ to /members/ accordingly.

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
@linear-code

linear-code Bot commented Jul 24, 2026

Copy link
Copy Markdown

REPLAY-947

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 24, 2026

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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})
);

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.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1dfe2b0. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant