-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ref(browser): Ensure idle span ending is consistent #12310
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
size-limit report 📦
|
@@ -130,7 +130,7 @@ export function startIdleSpan(startSpanOptions: StartSpanOptions, options: Parti | |||
// If we have no spans, we just end, nothing else to do here | |||
if (!spans.length) { | |||
onIdleSpanEnded(spanEndTimestamp); | |||
return Reflect.apply(target, thisArg, args); |
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.
Is this change intended? Me idiot.
a bit scary though this change 🤔 Can we make sure with a type that we forward all the args in case the api is ever expanded.
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.
Hard to do with a type as stuff would always have to be optional, so this would always match - but I added code to ensure we also pass rest arguments, so that is forwards-compatible!
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.
LGTM. Just one ask, can we change the PR title/commit msg type as this actually has SDK code changes?
lol nvm, you're too fast :D
15add0e
to
4fea67e
Compare
Saw this flake here: https://github.com/getsentry/sentry-javascript/actions/runs/9316244122/job/25644256391
It seems this was sometimes minimally flakey because we used a slightly different end time in the two places - no, we ensure to use the same, which should make this more consistent.