Skip to content

feat(server-utils): phase 2 of internal/server-utils refactor#21203

Draft
isaacs wants to merge 1 commit into
isaacs/sentry-internal-server-utilsfrom
isaacs/sentry-internal-server-utils-2
Draft

feat(server-utils): phase 2 of internal/server-utils refactor#21203
isaacs wants to merge 1 commit into
isaacs/sentry-internal-server-utilsfrom
isaacs/sentry-internal-server-utils-2

Conversation

@isaacs
Copy link
Copy Markdown
Member

@isaacs isaacs commented May 28, 2026

This moves most of the logic previously in @sentry/core/server into the new @sentry-internal/server-utils package.

BREAKING CHANGE: the @sentry/server/core is removed, because otherwise this would result in a dependency cycle.

This moves most of the logic previously in `@sentry/core/server` into
the new `@sentry-internal/server-utils` package.

BREAKING CHANGE: the @sentry/server/core is removed, because otherwise
this would result in a dependency cycle.
@isaacs isaacs requested review from a team as code owners May 28, 2026 04:16
@isaacs isaacs requested review from JPeer264, mydea and s1gr1d and removed request for a team May 28, 2026 04:16
@isaacs isaacs marked this pull request as draft May 28, 2026 04:17
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 670192f. Configure here.

enumerable,
value: wrapped,
});
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vendored wrapMethod and getDefaultExport duplicated in server-utils

Low Severity

The wrapMethod and getDefaultExport functions are identically vendored in both client-patch.ts and the Express index.ts within the same @sentry-internal/server-utils package. These two copies will need to be maintained in sync, increasing the risk of inconsistent bug fixes. They could be extracted into a shared internal utility file within the package. Flagging this because it was mentioned in this rules file.

Additional Locations (1)
Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit 670192f. Configure here.

timer.unref();
}
return timer;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vendored safeUnref instead of using core's new export

Low Severity

record-request-session.ts vendors a local safeUnref function, but @sentry/core now explicitly exports _INTERNAL_safeUnref (added in shared-exports.ts with a comment saying it's "exposed so that @sentry-internal/server-utils can build … without copying these internal helpers"). The vendored copy is redundant and could fall out of sync. Flagging this because it was mentioned in this rules file.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit 670192f. Configure here.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant