Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ describe('OrganizationSettingsForm', () => {
url: '/organizations/org-slug/members/',
body: [{user: UserFixture()}],
});
MockApiClient.addMockResponse({
url: '/organizations/org-slug/users/',
body: [{user: UserFixture()}],
});
onSave.mockReset();
});

Expand Down Expand Up @@ -413,7 +409,7 @@ describe('OrganizationSettingsForm', () => {
it('saves replayAccessMembers when a member is selected', async () => {
const user = UserFixture();
MockApiClient.addMockResponse({
url: `/organizations/${organization.slug}/users/`,
url: `/organizations/${organization.slug}/members/`,
body: [{user}],
});
const replayPutMock = MockApiClient.addMockResponse({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ import {
getLocalityDataFromOrganization,
shouldDisplayLocalities,
} from 'sentry/utils/cells';
import {useProjectMembersQueryOptions} from 'sentry/utils/members/projectMembers';
import {selectUsersFromMembers} from 'sentry/utils/members/shared';
import {memberUsersQueryOptions} from 'sentry/utils/members/shared';
import {fetchMutation} from 'sentry/utils/queryClient';
import {RequestError} from 'sentry/utils/requestError/requestError';
import {slugify} from 'sentry/utils/slugify';
Expand Down Expand Up @@ -86,10 +85,9 @@ export function ReplayAccessMembersField({
organization: Organization;
}) {
const endpoint = `/organizations/${organization.slug}/`;
const {data: members = [], isPending: fetching} = useQuery({
...useProjectMembersQueryOptions(),
select: resp => selectUsersFromMembers(resp.json),
});
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.

const memberOptions = members.map(m => ({value: m.id, label: m.name}));

const replayMutationOpts = mutationOptions({
Expand Down
Loading