Skip to content

Conversation

@ArthurKnaus
Copy link
Member

@ArthurKnaus ArthurKnaus commented Dec 10, 2025

Add org membership settings for allow-listing replay access.

Screen.Recording.2025-12-10.at.09.57.35.mov

Introduce a guard component <ReplayAccess/> to check for the new permissions and wrap it around affected product areas:

  • Embedded replay components (e.g. in issues details and trace details) simply get hidden.
  • Replay-only product surface that gets pointed to by navigation elements displays an alert about missing permissions (e.g. replay list / details).
Screenshot 2025-12-10 at 11 13 54

@ArthurKnaus ArthurKnaus requested a review from a team December 10, 2025 10:20
@ArthurKnaus ArthurKnaus requested review from a team as code owners December 10, 2025 10:20
@linear
Copy link

linear bot commented Dec 10, 2025

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Dec 10, 2025
Comment on lines +102 to +103
case 'sentry_member_selector':
return <SentryMemberSelectorField {...(componentProps as RenderFieldProps)} />;
Copy link
Member

Choose a reason for hiding this comment

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

Because of this name, at first, I thought this was just for Sentry employees 😁 I know you are just following the pattern, but why do we have this prefix?

Copy link
Member Author

Choose a reason for hiding this comment

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

🤷 I don't know

multiple: true,
visible: ({model, features}) =>
features.has('granular-replay-permissions') &&
model.getValue('hasGranularReplayPermissions'),
Copy link
Member

Choose a reason for hiding this comment

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

Won’t this cause the UI to jump? Wouldn’t it be better to show it as disabled with a tooltip, like we usually do?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is a very niche feature atm so I don't want it to take up too much space. I think it is fine to add this row directly underneath following the user interaction.

Comment on lines 149 to 153
await waitFor(() => {
expect(
screen.getByText("You don't have access to this feature")
).toBeInTheDocument();
});
Copy link
Member

Choose a reason for hiding this comment

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

can't we use await screen.findByText(...) here?

Copy link
Member Author

Choose a reason for hiding this comment

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

right, that would be easier! 😅

}
);

expect(screen.queryByText('Session Replay')).not.toBeInTheDocument();
Copy link
Member

Choose a reason for hiding this comment

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

if the component is an empty dom element, we can assume that this is not rendered right? can't we drop this and only have the expect below?

Comment on lines +285 to +287
await waitFor(() => {
expect(screen.queryByTestId('replay-table')).not.toBeInTheDocument();
});
Copy link
Member

Choose a reason for hiding this comment

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

wouldn't help if we wait for all loading indicators to be gone first?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah the problem is, we do not even render a loading indicator in this case...
I have no idea what in the document tree fires the request after ~45 minutes i resorted to this hacky solution :/

Comment on lines 168 to 170
expect(
screen.getByRole('checkbox', {name: 'Restrict Replay Access'})
).toBeInTheDocument();
Copy link
Member

Choose a reason for hiding this comment

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

should we check - just in case - if the checkbox is enabled as well?

Copy link
Member

@obostjancic obostjancic left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +22 to +30
export function ReplayAccessFallbackAlert() {
return (
<Alert
type="warning"
showIcon
defaultExpanded
expand={t(
'Replay access in this organization is limited to certain members. Please contact an organization admin to get access.'
)}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: the component name does not really indicate the reason for the fallback

@ArthurKnaus ArthurKnaus merged commit 21029f1 into master Dec 16, 2025
49 checks passed
@ArthurKnaus ArthurKnaus deleted the arthurknaus/tet-1563-granular-replay-permissions-frontend branch December 16, 2025 11:40
@github-actions github-actions bot locked and limited conversation to collaborators Dec 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants