-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: Add helper for old api to guide users to startTransaction #2625
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
Conversation
* @deprecated | ||
* We have this here as a fallback to not break users upgrading to the new API |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work in the middle of the func body? Did you mean to put if above the func signature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's more a marker for us once we have a major bump to delete this block and document the breaking change.
`Please use \`Sentry.startTransaction({name: ${(context as any).transaction}})\` to start a Transaction.`, | ||
); | ||
(context as TransactionContext).name = (context as any).transaction as string; | ||
(context as TransactionContext)._isTransaction = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may not have fully understood this from previous PRs. What does it mean for a TransactionContext
to be a Transaction (_isTransaction = true
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have another safeguard using when people call
Sentry.startTransaction
Since everything goes through hub.startSpan
internally with that _isTransaction
we can have the check when people use JS (without types) if they forget to set the name property
No description provided.