Skip to content

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

Merged
merged 12 commits into from
Jun 3, 2024

Conversation

mydea
Copy link
Member

@mydea mydea commented May 31, 2024

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.

@mydea mydea self-assigned this May 31, 2024
Copy link
Contributor

github-actions bot commented May 31, 2024

size-limit report 📦

Path Size
@sentry/browser 21.74 KB (0%)
@sentry/browser (incl. Tracing) 32.77 KB (+0.03% 🔺)
@sentry/browser (incl. Tracing, Replay) 68.34 KB (+0.02% 🔺)
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 61.65 KB (+0.02% 🔺)
@sentry/browser (incl. Tracing, Replay with Canvas) 72.41 KB (+0.02% 🔺)
@sentry/browser (incl. Tracing, Replay, Feedback) 84.5 KB (+0.02% 🔺)
@sentry/browser (incl. Tracing, Replay, Feedback, metrics) 86.36 KB (+0.02% 🔺)
@sentry/browser (incl. metrics) 25.92 KB (0%)
@sentry/browser (incl. Feedback) 37.89 KB (0%)
@sentry/browser (incl. sendFeedback) 26.32 KB (0%)
@sentry/browser (incl. FeedbackAsync) 30.86 KB (0%)
@sentry/react 24.51 KB (0%)
@sentry/react (incl. Tracing) 35.81 KB (+0.03% 🔺)
@sentry/vue 25.73 KB (0%)
@sentry/vue (incl. Tracing) 34.61 KB (+0.05% 🔺)
@sentry/svelte 21.87 KB (0%)
CDN Bundle 23.11 KB (0%)
CDN Bundle (incl. Tracing) 34.5 KB (+0.03% 🔺)
CDN Bundle (incl. Tracing, Replay) 68.43 KB (+0.02% 🔺)
CDN Bundle (incl. Tracing, Replay, Feedback) 73.6 KB (+0.02% 🔺)
CDN Bundle - uncompressed 68 KB (0%)
CDN Bundle (incl. Tracing) - uncompressed 102.18 KB (+0.02% 🔺)
CDN Bundle (incl. Tracing, Replay) - uncompressed 212.07 KB (+0.01% 🔺)
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 224.54 KB (+0.01% 🔺)
@sentry/nextjs (client) 35.16 KB (+0.04% 🔺)
@sentry/sveltekit (client) 33.4 KB (+0.04% 🔺)
@sentry/node 115.24 KB (0%)
@sentry/aws-serverless 103.72 KB (0%)

@mydea mydea marked this pull request as ready for review May 31, 2024 12:31
@mydea mydea requested review from lforst, Lms24 and andreiborza May 31, 2024 12:31
@@ -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);
Copy link
Contributor

@lforst lforst May 31, 2024

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.

Copy link
Member Author

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!

@mydea mydea changed the title test(browser): Fix flaky test fix(browser): Ensure idle span ending is consistent May 31, 2024
@mydea mydea changed the title fix(browser): Ensure idle span ending is consistent ref(browser): Ensure idle span ending is consistent May 31, 2024
Copy link
Member

@Lms24 Lms24 left a 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

@mydea mydea force-pushed the fn/unflake-browser-test branch from 15add0e to 4fea67e Compare June 3, 2024 09:53
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