.cursor/BUGBOT.md
You are reviewing a pull request for the Sentry JavaScript SDK. Flag any of the following indicators or missing requirements. If you find anything to flag, mention that you flagged this in the review because it was mentioned in this rules file. These issues are only relevant for production code. Do not flag the issues below if they appear in tests.
eval(), Function(), or innerHTML.filter, .foreach, chained). Suggest a classic for loop as a replacement.startSpan API (startInactiveSpan, startSpanManual, etc), always ensure that the following span attributes are set:
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN ('sentry.origin') with a proper span origin
_ and . characters.SEMANTIC_ATTRIBUTE_SENTRY_OP ('sentry.op') with a proper span op
. character is used to delimit op parts.captureException, always make sure that the mechanism is set:
handled: must be set to true or falsetype: must be set to a proper origin (i.e. identify the integration and part in the integration that caught the exception).
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN if a span wraps the captureException call.type value, following the same naming
convention as the SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN value.startSpan, check if error cases are handled. If flag that it might make sense to try/catch and call captureException.generateInstrumentationOnce, the passed in name MUST match the name of the integration that uses it. If there are more than one instrumentations, they need to follow the pattern ${INSTRUMENTATION_NAME}.some-suffix.feat PR, check if the PR includes at least one integration or E2E test.
If neither of the two are present, add a comment, recommending to add one.fix PR, check if the PR includes at least one unit, integration or e2e test that tests the regression this PR fixes.
Usually this means the test failed prior to the fix and passes with the fix.
If no tests are present, add a comment recommending to add one.expect.objectContaining and other relaxed assertions, when a test expects something NOT to be included in a payload but there's no respective assertion.(it)|(test).each instead.getFirstEnvelope*, getMultipleEnvelope* or related test helpers. These are NOT reliable anymore. Instead suggest helpers like waitForTransaction, waitForError, waitForSpans, etc.docker-compose.yml under dev-packages/node-integration-tests/suites/ or dev-packages/node-core-integration-tests/suites/ where a service does not define a healthcheck:. The runner uses docker compose up --wait and relies on healthchecks to know when services are actually ready; without one the test will race the service's startup.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.