Skip to content

Commit 29853f1

Browse files
authored
chore(bugbot): Add rule to flag not-unref'd timers (#19082)
Quick follow-up from #19062. Closes #19083 (added automatically)
1 parent cf9fed3 commit 29853f1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

.cursor/BUGBOT.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,8 @@ Do not flag the issues below if they appear in tests.
5858
- 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.
5959
- Flag usage of conditionals in one test and recommend splitting up the test for the different paths.
6060
- Flag usage of loops testing multiple scenarios in one test and recommend using `(it)|(test).each` instead.
61+
62+
## Platform-safe code
63+
64+
- 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.
65+
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.

0 commit comments

Comments
 (0)