GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(browser): Fix bug causing unintentional dropping of transactions by lforst · Pull Request #12933 · getsentry/sentry-javascript Conversation
|
To add some context, this happens for me with the replay integration and particularly for the spans for the request to the worker blob, and only in Chrome. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
5ef066c to
e96b4af
Compare
There was an error while loading. Please reload this page.
size-limit report 📦
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| // There is a SO post attempting to explain this, but it leaves one with open questions: https://stackoverflow.com/questions/23191918/peformance-getentries-and-negative-duration-display | ||
| // The way we clamp the value is probably not accurate, since we have observed this happen for things that may take a while to load, like for example the replay worker. | ||
| // TODO: Investigate why this happens and how to properly mitigate. For now, this is a workaround to prevent transactions being dropped due to negative duration spans. | ||
| entry.duration < 0 ? 0 : entry.duration, |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
l: any reason for not using Math.max?
| entry.duration < 0 ? 0 : entry.duration, | |
| Math.max(0, entry.duration), |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I have a theory that performance is better for the inline if but can change
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Just a comment on the comment but it looks like a reasonable guard.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| const duration = msToSec( | ||
| // Inexplicibly, Chrome sometimes emits a negative duration. We need to work around this. | ||
| // There is a SO post attempting to explain this, but it leaves one with open questions: https://stackoverflow.com/questions/23191918/peformance-getentries-and-negative-duration-display | ||
| // The way we clamp the value is probably not accurate, since we have observed this happen for things that may take a while to load, like for example the replay worker. |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
does the worker take a while to load though? I'd imagine creating the blob should be fairly fast since the code ships with the already loaded JS SDK bundle by default? My guess yesterday was the opposite: that it's too fast and therefore causing weird timing problems 😅
(maybe this is also blob-specific?)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think it loaded in something like 4ms when we tested it (which was locally in dev mode). So not too fast. Even if it loaded "too fast" a negative duration doesn't make sense in my eyes 🤔
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Pageloads traces aren't being captured by sentry/nextjs
There was an error while loading. Please reload this page.