Skip to content

@sentry/node: two notes whose "once we drop Node X" condition has passed — remove the workarounds, or refresh the notes? #24182

Description

@wittachai-as

Problem Statement

Two comments in @sentry/node say exactly when they should be removed, and both conditions have passed since the engine floor moved to Node >=20.19.0 (4f03438, "Require Node >=20.19.0", 2026-07-24):

  1. packages/node/src/integrations/anr/worker.ts — in createHrTimer():

    // TODO (v8): We can use process.hrtime.bigint() after we drop node v8

    Node 8 support is long gone (the SDK's own v8 shipped 2024-05-13), the floor is 20.19.0, and process.hrtime.bigint() has existed since Node 10.7.

  2. packages/node/src/integrations/node-fetch/undici-instrumentation.ts — above _channelSubs:

    // Keep ref to avoid https://github.com/nodejs/node/issues/42170 bug
    // We can replace this with _isInstrumented once we drop support for Node.js 18.18.0

    That support was dropped by this repository's own commit 4f03438 — two days after this line was last moved.

Whoever wrote these did it right: they wrote down the reason and the condition. The conditions are simply behind us now, and the notes still read as if they were pending.

Solution Brainstorm

Either outcome closes this cleanly:

  • Remove: createHrTimer() on process.hrtime.bigint(); _channelSubs replaced by a boolean _isInstrumented, exactly as the note itself proposes.
  • Or keep the code and rewrite the two notes with the current reason, so the next reader doesn't re-investigate a condition that already passed.

Happy to send the PR for the first — both changes are small and sit under existing tests. Filing the issue first per CONTRIBUTING so the PR has something to close.

Context: found while reading workaround notes across ~1,800 repositories (https://contextdebt.dev/report). This is a lead, not a verdict — "the condition passed" doesn't by itself prove removal is safe; that's what review is for.

Additional Context

No response

Priority

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions