-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
meta(changelog): Update changelog for 9.38.0 #16931
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
…hod (#16890) Related to #16846 This rewrites `timestampInSeconds` to avoid side effects. As a part of this, I also streamlined this a bit to remove special handling for missing `timeOrigin`. If that is missing, we just fall back to using `dateTimestampInSeconds`, instead of doing some custom handling of `timeOrigin` - IMHO that should not be any less accurate, as otherwise we are currently mixing `performance.now` with `Date.now()` which is likely not necessarily accurate either.
[Gitflow] Merge master into develop
Today the logger export from core has a side effect and reads from the global. This PR rewrites this to instead only keep the enabled flag on the carrier. The logger itself is a "normal" method that just looks at the carrier to see if logging is enabled or not.
We need to publish this package!
resolves #16903 ref #16901 This PR introduces a `debug` function that aims to replace `logger`. This gives us a couple of benefits: 1. communicates intent of the export much better 1. avoids collision with `logger` exported from other sdks (which is used for sentry structured logging) 1. we can move structured logging `logger` code into `@sentry/core`, reducing duplication across our sdks We don't deprecate `logger` just yet, we need to convert everything else in the other SDKs first.
…te (#16866) Refactor our CLS and LCP tracking and recording logic. We now have a `listenForWebVitalReportEvents` helper function which listens to page hides and navigation span starts and ensures that the standalone span logic is only called once per web vital. Previously, we had this logic in the CLS and LCP function and it was quite a lot of duplicated and identical code.
resolves #16909
CHANGELOG.md
Outdated
### Other Changes | ||
|
||
- feat(core): Introduce `debug` to replace `logger` ([#16906](https://github.com/getsentry/sentry-javascript/pull/16906)) | ||
- fix(browser): guard `nextHopProtocol` when adding resource spans ([#16900](https://github.com/getsentry/sentry-javascript/pull/16900)) |
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.
l:
- fix(browser): guard `nextHopProtocol` when adding resource spans ([#16900](https://github.com/getsentry/sentry-javascript/pull/16900)) | |
- fix(browser): Guard `nextHopProtocol` when adding resource spans ([#16900](https://github.com/getsentry/sentry-javascript/pull/16900)) |
2076cdc
to
ccf61b2
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.
Bug: Timestamp Function Fails to Use Performance API
The createUnixTimestampInSecondsFunc
now incorrectly falls back to dateTimestampInSeconds
in two scenarios:
- It no longer calculates an approximate
timeOrigin
whenperformance.timeOrigin
is unavailable butperformance.now()
is present, instead falling back entirely toDate.now()
. - The condition
!performance.timeOrigin
incorrectly triggers a fallback whenperformance.timeOrigin
is0
(a valid Unix epoch value), causing the function to useDate.now()
even when the Performance API is fully available.
packages/core/src/utils/time.ts#L34-L42
sentry-javascript/packages/core/src/utils/time.ts
Lines 34 to 42 in ccf61b2
const { performance } = GLOBAL_OBJ as typeof GLOBAL_OBJ & { performance?: Performance }; | |
// Some browser and environments don't have a performance or timeOrigin, so we fallback to | |
// using Date.now() to compute the starting time. | |
if (!performance?.now || !performance.timeOrigin) { | |
return dateTimestampInSeconds; | |
} | |
const timeOrigin = performance.timeOrigin; | |
Bug: Test Description Mismatch
The test description was updated to reference the debug
field, but the assertion still checks someEvent.logger
, creating an inconsistency.
packages/core/test/lib/integrations/captureconsole.test.ts#L127-L140
sentry-javascript/packages/core/test/lib/integrations/captureconsole.test.ts
Lines 127 to 140 in ccf61b2
it('should add an event processor that sets the `debug` field of events', () => { | |
const captureConsole = captureConsoleIntegration({ levels: ['log'] }); | |
captureConsole.setup?.(mockClient); | |
// call a wrapped function | |
GLOBAL_OBJ.console.log('some message'); | |
expect(mockScope.addEventProcessor).toHaveBeenCalledTimes(1); | |
const addedEventProcessor = (mockScope.addEventProcessor as Mock).mock.calls[0]?.[0]; | |
const someEvent: Event = {}; | |
addedEventProcessor(someEvent); | |
Was this report helpful? Give feedback by reacting with 👍 or 👎
size-limit report 📦
|
No description provided.