Skip to content

Conversation

@Lms24
Copy link
Member

@Lms24 Lms24 commented Oct 27, 2022

As brought to our attention in #6048, our pageload transaction start change (which makes the transaction start earlier) introduced in #5983 caused custom transaction names to be overwritten when beforeNavigate is used to update the transaction name.

This patch fixes this problem by checking for the transaction source before (not) updating the current transaction name with the resolved route name once the router's beforeEach hook was called. Furthermore, it adds a test to cover this case.

See #6048 (comment) for the motivation for creating this PR.

fixes #6047

@Lms24 Lms24 requested review from a team, AbhiPrasad and lobsterkatie and removed request for a team October 27, 2022 07:33
Comment on lines +95 to 99
if (pageloadTransaction.metadata.source !== 'custom') {
pageloadTransaction.setName(transactionName, transactionSource);
}
pageloadTransaction.setData('params', data.params);
pageloadTransaction.setData('query', data.query);
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 guess there's an argument to be made that if we have a custom source here, we don't need to set the params and query data. Happy to change this if reviewers prefer that.

Copy link
Member

Choose a reason for hiding this comment

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

I'm generally of the school of thought that (within reason) more data is better. We've been sending it before now, so I vote that we keep doing so.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. Then I'll keep it as is

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!

@Lms24 Lms24 changed the title fix(vue): Don't Overwrite Custom Transaction Names of Pageload Transactions fix(vue): Don't overwrite custom transaction names of pageload transactions Oct 27, 2022
@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.5 KB (+0.02% 🔺)
@sentry/browser - ES5 CDN Bundle (minified) 60.35 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.13 KB (-0.01% 🔽)
@sentry/browser - ES6 CDN Bundle (minified) 53.68 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 19.87 KB (0%)
@sentry/browser - Webpack (minified) 65.09 KB (0%)
@sentry/react - Webpack (gzipped + minified) 19.89 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 45.81 KB (0%)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 26.27 KB (+0.01% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 24.65 KB (+0.01% 🔺)

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.

The name of the transaction generated for the first time by the route hook of the vuerouter will be reset

3 participants