Skip to content

feat(v9/node): Capture SystemError context and remove paths from message #17394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 12, 2025

Conversation

timfish
Copy link
Collaborator

@timfish timfish commented Aug 12, 2025

@timfish timfish requested a review from AbhiPrasad August 12, 2025 14:56
Copy link
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.79 kB - -
@sentry/browser - with treeshaking flags 22.36 kB - -
@sentry/browser (incl. Tracing) 39.66 kB - -
@sentry/browser (incl. Tracing, Replay) 77.77 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 67.56 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 82.47 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 94.56 kB - -
@sentry/browser (incl. Feedback) 40.48 kB - -
@sentry/browser (incl. sendFeedback) 28.48 kB - -
@sentry/browser (incl. FeedbackAsync) 33.37 kB - -
@sentry/react 25.55 kB - -
@sentry/react (incl. Tracing) 41.62 kB - -
@sentry/vue 28.24 kB - -
@sentry/vue (incl. Tracing) 41.45 kB - -
@sentry/svelte 23.81 kB - -
CDN Bundle 25.18 kB - -
CDN Bundle (incl. Tracing) 39.42 kB - -
CDN Bundle (incl. Tracing, Replay) 75.39 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 80.87 kB - -
CDN Bundle - uncompressed 73.45 kB - -
CDN Bundle (incl. Tracing) - uncompressed 116.86 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 231.01 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 243.83 kB - -
@sentry/nextjs (client) 43.66 kB - -
@sentry/sveltekit (client) 40.08 kB - -
@sentry/node 169.37 kB +0.11% +175 B 🔺
@sentry/node - without tracing 100.51 kB +0.2% +200 B 🔺
@sentry/aws-serverless 128.67 kB +0.16% +197 B 🔺

View base workflow run

@timfish timfish marked this pull request as ready for review August 12, 2025 15:12
}
if (error.dest && exception.value.includes(error.dest)) {
exception.value = exception.value.replace(`'${error.dest}'`, '').trim();
}
Copy link

Choose a reason for hiding this comment

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

Bug: Error Message Handling and Context Population Issues

The systemErrorIntegration has two distinct issues:

  1. The logic to remove path and dest from exception messages assumes they are wrapped in single quotes and uses replace() which only removes the first occurrence. This fails if paths are unquoted, use different quotes, contain single quotes, or appear multiple times, potentially leaving malformed messages.
  2. The node_system_error context is populated by spreading the entire Error object, including base Error properties like name, message, and stack. This adds unnecessary data and can lead to unintended information leakage. Only SystemError-specific properties should be included.
Fix in Cursor Fix in Web

@AbhiPrasad AbhiPrasad merged commit 2c36fd3 into v9 Aug 12, 2025
158 checks passed
@AbhiPrasad AbhiPrasad deleted the timfish/feat/system-error-backport branch August 12, 2025 15:23
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.

2 participants