Skip to content

Conversation

@scefali
Copy link
Contributor

@scefali scefali commented Sep 30, 2020

This PR converts the normalizeTransactionName to a function that takes a callback instead of returning a value. This is to fix a bug where normalizeTransactionName returns a value before the callback passed to match is called. In that case, we end up returning the wrong value and the transaction name is incorrect. We see this in Sentry where we get a transaction for /settings/sentry/integrations/ instead of /settings/:orgId/integrations/. This happens because the callback passed to match might be called asynchronously (https://github.com/ReactTraining/react-router/blob/42fe32d8f4ebec170a6d980badbc702ab88b5897/modules/matchRoutes.js#L249). So we need a callback here as well to get the proper behavior.

I tried to test this with Sentry but I think version 5.25.0-beta.2 introduces some breaking changes compared to 5.24.2 which is what we currently use.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 30, 2020

size-limit report

Path Size
@sentry/browser - CDN Bundle (gzipped) 18.01 KB (0%)
@sentry/browser - Webpack 18.82 KB (0%)
@sentry/react - Webpack 18.82 KB (0%)
@sentry/browser + @sentry/tracing - CDN Bundle (gzipped) 23.81 KB (0%)

Copy link
Member

@lobsterkatie lobsterkatie left a comment

Choose a reason for hiding this comment

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

LGTM!

@scefali scefali merged commit 1a17399 into master Sep 30, 2020
@scefali scefali deleted the fix/react-router-v3-callback-path branch September 30, 2020 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants