Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle redirects causing navigations instead of pageloads #14492

Open
AbhiPrasad opened this issue Nov 26, 2024 · 0 comments
Open

Handle redirects causing navigations instead of pageloads #14492

AbhiPrasad opened this issue Nov 26, 2024 · 0 comments
Assignees
Labels
Package: react Issues related to the Sentry React SDK Sync: Jira apply to auto-create a Jira shadow ticket

Comments

@AbhiPrasad
Copy link
Member

AbhiPrasad commented Nov 26, 2024

Description

For a setup like the following:

const router = sentryCreateHashRouter(
  [
    {
      path: '/',
      element: (
        <Layout/>
      ),
      children: [
        { index: true, element: <BaseRouteRedirect /> },
        { path: '/a', element: <PageA /> },
        { path: '/b/view', element: <PageB /> },
        { path: '*', element: <NoMatch /> },
      ],
    },
  ]
);

When the index route, / is hit, a redirect happens to either page a or page b. This is effectively a redirect guard.

As a consequence, there is no pageloads, instead only navigations, which means that web vital values are not properly calculated for these routes.

We need to figure out a way to make sure that the SDK is aware of this pattern. Essentially redirects should be treated as part of the pageload, with just the name being updated. This needs the code to be handled a little differently.

Relevant slack thread internally: https://sentry.slack.com/archives/C4E31MGD8/p1731320946423889

┆Issue is synchronized with this Jira Improvement by Unito

@AbhiPrasad AbhiPrasad added the Package: react Issues related to the Sentry React SDK label Nov 26, 2024
@AbhiPrasad AbhiPrasad self-assigned this Nov 26, 2024
@Angelodaniel Angelodaniel added the Sync: Jira apply to auto-create a Jira shadow ticket label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: react Issues related to the Sentry React SDK Sync: Jira apply to auto-create a Jira shadow ticket
Projects
None yet
Development

No branches or pull requests

2 participants