From 1077ff0edcbd33988fc2545383c89cd4226c7ca3 Mon Sep 17 00:00:00 2001 From: Julian Gruber Date: Fri, 26 Apr 2024 18:40:36 +0200 Subject: [PATCH 1/5] zinnia: fix double reporting of crash errors --- lib/zinnia.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/zinnia.js b/lib/zinnia.js index 03adfea4..1b4fc31e 100644 --- a/lib/zinnia.js +++ b/lib/zinnia.js @@ -53,6 +53,9 @@ const maybeReportErrorToSentry = (/** @type {unknown} */ err) => { /** @type {Parameters[1]} */ const hint = { extra: {} } if (typeof err === 'object') { + if ('shouldReportToSentry' in err && err.shouldReportToSentry === false) { + return + } if ('details' in err && typeof err.details === 'string') { // Quoting from https://develop.sentry.dev/sdk/data-handling/ // > Messages are limited to 8192 characters. @@ -276,6 +279,8 @@ const catchChildProcessExit = async ({ maybeReportErrorToSentry(moduleErr) }) } + // If it should be reported, it was already handled + err.reportToSentry = false throw err } } finally { From c0892f6fe196b11ab3e942b9ffae3a5c0c2e0509 Mon Sep 17 00:00:00 2001 From: Julian Gruber Date: Mon, 29 Apr 2024 16:33:02 +0200 Subject: [PATCH 2/5] refactor --- lib/zinnia.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/zinnia.js b/lib/zinnia.js index 1b4fc31e..6cf71005 100644 --- a/lib/zinnia.js +++ b/lib/zinnia.js @@ -53,9 +53,10 @@ const maybeReportErrorToSentry = (/** @type {unknown} */ err) => { /** @type {Parameters[1]} */ const hint = { extra: {} } if (typeof err === 'object') { - if ('shouldReportToSentry' in err && err.shouldReportToSentry === false) { + if ('reportToSentry' in err && err.reportToSentry === false) { return } + Object.assign(err, { reportToSentry: false }) if ('details' in err && typeof err.details === 'string') { // Quoting from https://develop.sentry.dev/sdk/data-handling/ // > Messages are limited to 8192 characters. @@ -279,8 +280,6 @@ const catchChildProcessExit = async ({ maybeReportErrorToSentry(moduleErr) }) } - // If it should be reported, it was already handled - err.reportToSentry = false throw err } } finally { From c8073861d97fd9595924e6d6bae6432efac983e2 Mon Sep 17 00:00:00 2001 From: Julian Gruber Date: Tue, 30 Apr 2024 08:20:52 +0200 Subject: [PATCH 3/5] update sentry key --- bin/station.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/station.js b/bin/station.js index ab6825fd..5c878542 100755 --- a/bin/station.js +++ b/bin/station.js @@ -10,7 +10,7 @@ import * as paths from '../lib/paths.js' const pkg = JSON.parse(await fs.readFile(paths.packageJSON, 'utf8')) Sentry.init({ - dsn: 'https://6c96a5c2ffa5448d9ec8ddda90012bc9@o1408530.ingest.sentry.io/4504792315199488', + dsn: 'https://0269983069b7f77f9aab04686c3912e4@o1408530.ingest.us.sentry.io/4504792315199488', release: pkg.version, environment: pkg.sentryEnvironment, tracesSampleRate: 0.1, From a8208b7b745de6be499b9a9b87e844f543a9333c Mon Sep 17 00:00:00 2001 From: Julian Gruber Date: Thu, 2 May 2024 22:54:47 -0700 Subject: [PATCH 4/5] Update lib/zinnia.js --- lib/zinnia.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/zinnia.js b/lib/zinnia.js index 6cf71005..89f9b97f 100644 --- a/lib/zinnia.js +++ b/lib/zinnia.js @@ -53,10 +53,10 @@ const maybeReportErrorToSentry = (/** @type {unknown} */ err) => { /** @type {Parameters[1]} */ const hint = { extra: {} } if (typeof err === 'object') { - if ('reportToSentry' in err && err.reportToSentry === false) { + if ('reportedToSentry' in err && err.reportToSentry === true) { return } - Object.assign(err, { reportToSentry: false }) + Object.assign(err, { reportedToSentry: true }) if ('details' in err && typeof err.details === 'string') { // Quoting from https://develop.sentry.dev/sdk/data-handling/ // > Messages are limited to 8192 characters. From 058a382edbe02cb716ef07ca202301802f1523af Mon Sep 17 00:00:00 2001 From: Julian Gruber Date: Thu, 2 May 2024 22:55:53 -0700 Subject: [PATCH 5/5] Update lib/zinnia.js --- lib/zinnia.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/zinnia.js b/lib/zinnia.js index 89f9b97f..1d85122f 100644 --- a/lib/zinnia.js +++ b/lib/zinnia.js @@ -53,7 +53,7 @@ const maybeReportErrorToSentry = (/** @type {unknown} */ err) => { /** @type {Parameters[1]} */ const hint = { extra: {} } if (typeof err === 'object') { - if ('reportedToSentry' in err && err.reportToSentry === true) { + if ('reportedToSentry' in err && err.reportedToSentry === true) { return } Object.assign(err, { reportedToSentry: true })