From e3306a6c25efef53a73a56b0531f277e0e3d3ac4 Mon Sep 17 00:00:00 2001 From: Josh Kelley Date: Thu, 21 Mar 2024 11:39:42 -0400 Subject: [PATCH 1/2] fix(node): Time zone handling for `cron` (#11225) The `cron` package uses `timeZone`, while Sentry internally uses `timezone`. This caused Sentry cron jobs to be incorrectly upserted with no time zone information. Because of the use of the `...(timeZone ? { timeZone } : undefined)` idiom, TypeScript type checking did not catch the mistake. I kept `cron`'s `timeZone` capitalization within Sentry's instrumentation and changed from the `...(timeZone ? { timeZone } : undefined)` idiom so TypeScript could catch mistakes of this sort. (Passing an undefined `timezone` appears to be okay, because Sentry's `node-cron` instrumentation does it.) --- packages/node/src/cron/cron.ts | 4 ++-- packages/node/test/cron.test.ts | 21 ++++++++++++++------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/packages/node/src/cron/cron.ts b/packages/node/src/cron/cron.ts index 2540d82e736b..8b6fc324a7a6 100644 --- a/packages/node/src/cron/cron.ts +++ b/packages/node/src/cron/cron.ts @@ -100,7 +100,7 @@ export function instrumentCron(lib: T & CronJobConstructor, monitorSlug: stri }, { schedule: { type: 'crontab', value: cronString }, - ...(timeZone ? { timeZone } : {}), + timezone: timeZone || undefined, }, ); } @@ -132,7 +132,7 @@ export function instrumentCron(lib: T & CronJobConstructor, monitorSlug: stri }, { schedule: { type: 'crontab', value: cronString }, - ...(timeZone ? { timeZone } : {}), + timezone: timeZone || undefined, }, ); }; diff --git a/packages/node/test/cron.test.ts b/packages/node/test/cron.test.ts index eee6d4a66711..d068280a41e0 100644 --- a/packages/node/test/cron.test.ts +++ b/packages/node/test/cron.test.ts @@ -53,13 +53,20 @@ describe('cron check-ins', () => { const CronJobWithCheckIn = cron.instrumentCron(CronJobMock, 'my-cron-job'); - new CronJobWithCheckIn('* * * Jan,Sep Sun', () => { - expect(withMonitorSpy).toHaveBeenCalledTimes(1); - expect(withMonitorSpy).toHaveBeenLastCalledWith('my-cron-job', expect.anything(), { - schedule: { type: 'crontab', value: '* * * 1,9 0' }, - }); - done(); - }); + new CronJobWithCheckIn( + '* * * Jan,Sep Sun', + () => { + expect(withMonitorSpy).toHaveBeenCalledTimes(1); + expect(withMonitorSpy).toHaveBeenLastCalledWith('my-cron-job', expect.anything(), { + schedule: { type: 'crontab', value: '* * * 1,9 0' }, + timezone: 'America/Los_Angeles', + }); + done(); + }, + undefined, + true, + 'America/Los_Angeles', + ); }); test('CronJob.from()', done => { From 4f5d487d08f66ec394925ea4a1fd31d983ea61d7 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Thu, 21 Mar 2024 16:20:25 -0400 Subject: [PATCH 2/2] meta: CHANGELOG for 7.108.0 --- CHANGELOG.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c472c158f03e..6787582ad3d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,25 @@ - "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott +## 7.108.0 + +This release fixes issues with Time to First Byte (TTFB) calculation in the SDK that was introduced with `7.95.0`. It +also fixes some bugs with Interaction to First Paint (INP) instrumentation. This may impact your Sentry Performance +Score calculation. + +- feat(serverless): Add Node.js 20 to compatible runtimes (#11104) +- feat(core): Backport `ResizeObserver` and `googletag` default filters (#11210) +- feat(webvitals): Adds event entry names for INP handler. Also guard against empty metric value +- fix(metrics): use correct statsd data category (#11187) +- fix(node): Record local variables with falsy values (v7) (#11190) +- fix(node): Use unique variable for ANR context transfer (v7) (#11162) +- fix(node): Time zone handling for `cron` (#11225) +- fix(tracing): use web-vitals ttfb calculation (#11231) +- fix(types): Fix incorrect `sampled` type on `Transaction` (#11146) +- fix(webvitals): Fix mapping not being maintained properly and sometimes not sending INP spans (#11183) + +Work in this release contributed by @quisido and @joshkel. Thank you for your contributions! + ## 7.107.0 This release fixes issues with INP instrumentation with the Next.js SDK and adds support for the `enableInp` option in