From 3038eec15005243dfb64face9f26864160ab715c Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Thu, 29 Jan 2026 14:06:15 +0100 Subject: [PATCH 1/2] chore(bugbor): Add rule to flag not-unref'd timers --- .cursor/BUGBOT.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.cursor/BUGBOT.md b/.cursor/BUGBOT.md index eac3a13be13a..b4315e56766c 100644 --- a/.cursor/BUGBOT.md +++ b/.cursor/BUGBOT.md @@ -58,3 +58,8 @@ Do not flag the issues below if they appear in tests. - Flag usage of `expect.objectContaining` and other relaxed assertions, when a test expects something NOT to be included in a payload but there's no respective assertion. - Flag usage of conditionals in one test and recommend splitting up the test for the different paths. - Flag usage of loops testing multiple scenarios in one test and recommend using `(it)|(test).each` instead. + +## Platform-safe code + +- When any `setTimeout` or `setInterval` timers are started in a code path that can end up in server runtime packages (e.g. `@sentry/core` or `@sentry/node`), flag if neither `timeout.unref()` or `safeUnref()` are called. + Not unref'ing a timer can cause CLI or node scripts to run longer than before, due to the process waiting on timers started by the SDK. From a0e3e98695ce537aad426212089071f9e8541740 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Thu, 29 Jan 2026 19:23:03 +0100 Subject: [PATCH 2/2] Apply suggestions from code review --- .cursor/BUGBOT.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.cursor/BUGBOT.md b/.cursor/BUGBOT.md index b4315e56766c..0ac58c1503ec 100644 --- a/.cursor/BUGBOT.md +++ b/.cursor/BUGBOT.md @@ -61,5 +61,5 @@ Do not flag the issues below if they appear in tests. ## Platform-safe code -- When any `setTimeout` or `setInterval` timers are started in a code path that can end up in server runtime packages (e.g. `@sentry/core` or `@sentry/node`), flag if neither `timeout.unref()` or `safeUnref()` are called. - Not unref'ing a timer can cause CLI or node scripts to run longer than before, due to the process waiting on timers started by the SDK. +- When any `setTimeout` or `setInterval` timers are started in a code path that can end up in server runtime packages (e.g. `@sentry/core` or `@sentry/node`), flag if neither `timeout.unref()` nor `safeUnref()` are called. + Not unref'ing a timer can keep CLI-like applications or node scripts from exiting immediately, due to the process waiting on timers started by the SDK.