-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(vue): prevent after hook from starting new span #4438
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
074fdb9
to
ac72ee4
Compare
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.
Awesome, thanks for the PR!
We don't have amazing test coverage for Vue, I opened a issue to track it: #4440
I would leave the PR without tests for now, but help for tests are always appreciated!
packages/vue/src/tracing.ts
Outdated
@@ -66,7 +66,9 @@ export const createTracingMixins = (options: TracingOptions): Mixins => { | |||
continue; | |||
} | |||
|
|||
for (const internalHook of internalHooks) { | |||
internalHooks.forEach((internalHook, hookType) => { |
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.
Why change to forEach
?
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 is meant to retrieve hookType
. Are you thinking checking internalHook === internalHooks[1]
would suffice?
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 have discarded the change and updated to compare internalHook
with internalHooks
directly.
packages/vue/src/tracing.ts
Outdated
@@ -66,7 +66,9 @@ export const createTracingMixins = (options: TracingOptions): Mixins => { | |||
continue; | |||
} | |||
|
|||
for (const internalHook of internalHooks) { | |||
internalHooks.forEach((internalHook, hookType) => { | |||
const isBeforeHook = hookType === 0; |
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.
Any reason this need to be a variable? Only used once in the if statement - and I think the meaning is pretty clear without the need of a variable.
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.
ok let me update it
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.
updated
ac72ee4
to
093de9f
Compare
yarn lint
) & (yarn test
).Fix issue similar to #4427, where:
Notes:
ui.vue.activate
I'm not able to find any existing tracing tests, so please tell me what I should do with the testing if necessary.