From d8aae79b35807e36e5f1d9cf6a518602c32d1b12 Mon Sep 17 00:00:00 2001 From: "sentry[bot]" <39604003+sentry[bot]@users.noreply.github.com> Date: Sat, 24 Oct 2026 10:54:56 +0000 Subject: [PATCH 1/2] fix(shared-issues): Use hard navigation for Details link to prevent missing org context --- static/app/views/sharedGroupDetails/index.spec.tsx | 10 +++++++++- static/app/views/sharedGroupDetails/index.tsx | 9 +++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/static/app/views/sharedGroupDetails/index.spec.tsx b/static/app/views/sharedGroupDetails/index.spec.tsx index 60834dfba91c..89de56ed8fcc 100644 --- a/static/app/views/sharedGroupDetails/index.spec.tsx +++ b/static/app/views/sharedGroupDetails/index.spec.tsx @@ -70,7 +70,15 @@ describe('SharedGroupDetails', () => { route: '/organizations/:orgId/share/issue/:shareId/', }, }); - expect(await screen.findByText('Details')).toBeInTheDocument(); + // The "Details" link must be a hard-navigation anchor (not a React Router + // Link) so clicking it triggers a full page load and the issue detail route + // boots with the correct org context. An in-app navigation would unmount + // this page's OrganizationContext, leaving child components that call + // useOrganization() with a null context and causing them to throw. + const detailsLink = await screen.findByRole('link', {name: 'Details'}); + expect(detailsLink).toBeInTheDocument(); + expect(detailsLink.tagName).toBe('A'); + expect(detailsLink).toHaveAttribute('href', 'https://foo.io/organizations/foo/issues/1234/'); expect(await screen.findByTestId('sgh-timestamp')).toBeInTheDocument(); }); diff --git a/static/app/views/sharedGroupDetails/index.tsx b/static/app/views/sharedGroupDetails/index.tsx index 2f994596b8a6..7d3c293018d3 100644 --- a/static/app/views/sharedGroupDetails/index.tsx +++ b/static/app/views/sharedGroupDetails/index.tsx @@ -92,9 +92,14 @@ function SharedGroupDetails() { {group.permalink && ( - + // Use a hard navigation (not React Router in-app nav) so the + // app re-bootstraps with the correct org context. An in-app + // navigation unmounts this page's OrganizationContext before + // the issue detail route has a chance to load its own, causing + // useOrganization() calls in child components to throw. + {t('Details')} - + )}
From ef7137250718d3da9886677e327bb6d22a229329 Mon Sep 17 00:00:00 2001 From: "getsantry[bot]" <66042841+getsantry[bot]@users.noreply.github.com> Date: Sat, 24 Oct 2026 10:56:34 +0000 Subject: [PATCH 2/2] :hammer_and_wrench: apply pre-commit fixes --- static/app/views/sharedGroupDetails/index.spec.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/static/app/views/sharedGroupDetails/index.spec.tsx b/static/app/views/sharedGroupDetails/index.spec.tsx index 89de56ed8fcc..1e821ed3a5eb 100644 --- a/static/app/views/sharedGroupDetails/index.spec.tsx +++ b/static/app/views/sharedGroupDetails/index.spec.tsx @@ -78,7 +78,10 @@ describe('SharedGroupDetails', () => { const detailsLink = await screen.findByRole('link', {name: 'Details'}); expect(detailsLink).toBeInTheDocument(); expect(detailsLink.tagName).toBe('A'); - expect(detailsLink).toHaveAttribute('href', 'https://foo.io/organizations/foo/issues/1234/'); + expect(detailsLink).toHaveAttribute( + 'href', + 'https://foo.io/organizations/foo/issues/1234/' + ); expect(await screen.findByTestId('sgh-timestamp')).toBeInTheDocument(); });