Skip to content
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

fix: prevent invalid error stack traces #617

Merged
merged 3 commits into from
Jul 17, 2023
Merged

Conversation

patrickhousley
Copy link
Contributor

Removing the instantiation of the Error class in the jserrors feature for instances where a non-Error value is thrown from customer's code. In such cases, an Error instance would be created and the stack trace would point back to the agent code as the source. This causes confusion since it makes it seem like the agent code is throwing the error when that is not the case. Instead, the internal UncaughtError class will be used and no stack trace will exist.

Overview

Addressing PR comments from #614.

Related Issue(s)

https://issues.newrelic.com/browse/NR-138375

Testing

@github-actions
Copy link

github-actions bot commented Jul 14, 2023

Static Badge

Last ran on July 17, 2023 11:16:23 CDT
Checking merge of (95e6ddf) into main (e393c96)

@codecov
Copy link

codecov bot commented Jul 14, 2023

Codecov Report

Merging #617 (db8272e) into main (14d4294) will decrease coverage by 0.06%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main     #617      +/-   ##
==========================================
- Coverage   66.70%   66.65%   -0.06%     
==========================================
  Files         130      130              
  Lines        6007     6009       +2     
  Branches     1137     1141       +4     
==========================================
- Hits         4007     4005       -2     
- Misses       1636     1639       +3     
- Partials      364      365       +1     
Flag Coverage Δ
jest-component 21.15% <0.00%> (-0.02%) ⬇️
jest-unit 22.28% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/features/jserrors/constants.js 100.00% <ø> (ø)
src/features/jserrors/instrument/index.js 34.28% <0.00%> (-3.95%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@github-actions
Copy link

github-actions bot commented Jul 14, 2023

Asset Size Report

Merging this pull request will result in the following CDN asset size changes:

Asset Name Previous Size New Size Diff
nr-loader-spa.min 51.01 kB / 17.12 kB (gzip) 51.04 kB / 17.14 kB (gzip) +0.06% / +0.11% (gzip)
nr-loader-full.min 44.58 kB / 15.17 kB (gzip) 44.61 kB / 15.2 kB (gzip) +0.07% / +0.16% (gzip)
nr-loader-rum.min 27.84 kB / 9.92 kB (gzip) 27.84 kB / 9.92 kB (gzip) -0% / +0.02% (gzip)
nr-loader-spa-polyfills.min 124.41 kB / 39.44 kB (gzip) 124.47 kB / 39.47 kB (gzip) +0.04% / +0.07% (gzip)
nr-loader-full-polyfills.min 116.41 kB / 37.33 kB (gzip) 116.46 kB / 37.35 kB (gzip) +0.05% / +0.08% (gzip)
nr-loader-rum-polyfills.min 96.45 kB / 31.58 kB (gzip) 96.45 kB / 31.58 kB (gzip) -0% / -0% (gzip)
nr-loader-worker.min 41.14 kB / 13.9 kB (gzip) 41.17 kB / 13.92 kB (gzip) +0.08% / +0.15% (gzip)

Merging this pull request will result in the following NPM package consumer size changes:

Asset Name Previous Size New Size Diff
Browser Agent 51.14 kB / 17.02 kB (gzip) 51.18 kB / 17.04 kB (gzip) +0.06% / +0.12% (gzip)
Custom Lite Agent 27.99 kB / 9.85 kB (gzip) 27.99 kB / 9.85 kB (gzip) -0% / -0% (gzip)
Custom Pro Agent 44.63 kB / 15 kB (gzip) 44.66 kB / 15.02 kB (gzip) +0.07% / +0.14% (gzip)
Custom SPA Agent 51.03 kB / 16.98 kB (gzip) 51.06 kB / 17 kB (gzip) +0.06% / +0.12% (gzip)
Worker Agent 304.66 kB / 94.11 kB (gzip) 304.69 kB / 94.14 kB (gzip) +0.01% / +0.02% (gzip)
Other Standard CDN Assets

Released Assets

Asset Name Asset Size
recorder.1b18459f.min.js 166.07 kB / 52.32 kB (gzip)
spa-aggregate.68f643e9.min.js 20.93 kB / 7.42 kB (gzip)
page_view_timing-aggregate.d7fbc4fb.min.js 14.97 kB / 5.43 kB (gzip)
860.e349dcb2.min.js 14.09 kB / 5.27 kB (gzip)
session_trace-aggregate.973a2a56.min.js 12.24 kB / 4.53 kB (gzip)
page_view_event-aggregate.c8b08262.min.js 11.1 kB / 4.19 kB (gzip)
jserrors-aggregate.15addcc3.min.js 9.55 kB / 3.65 kB (gzip)
metrics-aggregate.8f3b1670.min.js 8.56 kB / 2.93 kB (gzip)
646.fd5f577f.min.js 8.04 kB / 3.32 kB (gzip)
session_replay-aggregate.29998cae.min.js 7.94 kB / 2.91 kB (gzip)
ajax-aggregate.449a907c.min.js 7.13 kB / 3.06 kB (gzip)
compressor.ae9f91a8.min.js 7.09 kB / 3.57 kB (gzip)
page_action-aggregate.da8a4bbf.min.js 4.73 kB / 1.92 kB (gzip)
async-api.30bd804e.min.js 2.92 kB / 1.46 kB (gzip)
session-manager.2a64278a.min.js 1.47 kB / 740 B (gzip)
lazy-feature-loader.94d9d1a8.min.js 1.17 kB / 498 B (gzip)

Built Assets

Asset Name Asset Size
recorder.1b18459f.min.js 166.07 kB / 52.32 kB (gzip)
spa-aggregate.68f643e9.min.js 20.93 kB / 7.42 kB (gzip)
page_view_timing-aggregate.d7fbc4fb.min.js 14.97 kB / 5.43 kB (gzip)
860.e349dcb2.min.js 14.09 kB / 5.27 kB (gzip)
session_trace-aggregate.973a2a56.min.js 12.24 kB / 4.53 kB (gzip)
page_view_event-aggregate.c8b08262.min.js 11.1 kB / 4.19 kB (gzip)
jserrors-aggregate.86f3591a.min.js 9.55 kB / 3.65 kB (gzip)
metrics-aggregate.8f3b1670.min.js 8.56 kB / 2.93 kB (gzip)
646.fd5f577f.min.js 8.04 kB / 3.32 kB (gzip)
session_replay-aggregate.29998cae.min.js 7.94 kB / 2.91 kB (gzip)
ajax-aggregate.449a907c.min.js 7.13 kB / 3.06 kB (gzip)
compressor.ae9f91a8.min.js 7.09 kB / 3.57 kB (gzip)
page_action-aggregate.da8a4bbf.min.js 4.73 kB / 1.92 kB (gzip)
async-api.30bd804e.min.js 2.92 kB / 1.46 kB (gzip)
session-manager.2a64278a.min.js 1.47 kB / 740 B (gzip)
lazy-feature-loader.94d9d1a8.min.js 1.17 kB / 498 B (gzip)
Other Polyfill CDN Assets

Released Assets

Asset Name Asset Size
recorder.1b18459f-es5.min.js 166.76 kB / 52.35 kB (gzip)
nr-polyfills.min.js 52.15 kB / 17.95 kB (gzip)
session_trace-aggregate.c6e2d80e-es5.min.js 32.26 kB / 8.5 kB (gzip)
compressor.79fb47d9-es5.min.js 30.02 kB / 11.29 kB (gzip)
spa-aggregate.cf7614a6-es5.min.js 24.02 kB / 8.11 kB (gzip)
session_replay-aggregate.307e7ec3-es5.min.js 19.24 kB / 6.52 kB (gzip)
page_view_timing-aggregate.4cf1986a-es5.min.js 18.67 kB / 6.17 kB (gzip)
173.71bbedb0-es5.min.js 17.41 kB / 6.14 kB (gzip)
page_view_event-aggregate.7a2d4522-es5.min.js 12.64 kB / 4.8 kB (gzip)
jserrors-aggregate.d1e7ac8a-es5.min.js 12.33 kB / 4.4 kB (gzip)
385.1f3686e5-es5.min.js 10.62 kB / 4.16 kB (gzip)
ajax-aggregate.34fb41fa-es5.min.js 10.58 kB / 3.78 kB (gzip)
metrics-aggregate.9be0ba0b-es5.min.js 9.91 kB / 3.35 kB (gzip)
page_action-aggregate.710c9b26-es5.min.js 7.33 kB / 2.64 kB (gzip)
async-api.2b4763c8-es5.min.js 4.16 kB / 1.99 kB (gzip)
session-manager.ae4f9cf3-es5.min.js 1.7 kB / 785 B (gzip)
lazy-feature-loader.60c98be9-es5.min.js 1.2 kB / 509 B (gzip)

Built Assets

Asset Name Asset Size
recorder.1b18459f-es5.min.js 166.76 kB / 52.35 kB (gzip)
nr-polyfills.min.js 52.15 kB / 17.95 kB (gzip)
session_trace-aggregate.c6e2d80e-es5.min.js 32.26 kB / 8.5 kB (gzip)
compressor.79fb47d9-es5.min.js 30.02 kB / 11.29 kB (gzip)
spa-aggregate.cf7614a6-es5.min.js 24.02 kB / 8.11 kB (gzip)
session_replay-aggregate.307e7ec3-es5.min.js 19.24 kB / 6.52 kB (gzip)
page_view_timing-aggregate.4cf1986a-es5.min.js 18.67 kB / 6.17 kB (gzip)
173.71bbedb0-es5.min.js 17.41 kB / 6.14 kB (gzip)
page_view_event-aggregate.7a2d4522-es5.min.js 12.64 kB / 4.8 kB (gzip)
jserrors-aggregate.69bf7e5d-es5.min.js 12.33 kB / 4.4 kB (gzip)
385.1f3686e5-es5.min.js 10.62 kB / 4.16 kB (gzip)
ajax-aggregate.34fb41fa-es5.min.js 10.58 kB / 3.78 kB (gzip)
metrics-aggregate.9be0ba0b-es5.min.js 9.91 kB / 3.35 kB (gzip)
page_action-aggregate.710c9b26-es5.min.js 7.33 kB / 2.64 kB (gzip)
async-api.2b4763c8-es5.min.js 4.16 kB / 1.99 kB (gzip)
session-manager.ae4f9cf3-es5.min.js 1.7 kB / 785 B (gzip)
lazy-feature-loader.60c98be9-es5.min.js 1.2 kB / 509 B (gzip)

Copy link
Contributor

@cwli24 cwli24 left a comment

Choose a reason for hiding this comment

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

Some of the tests need re-adjusting

@patrickhousley
Copy link
Contributor Author

Verified the Safari 15 test failures were due to known SL Safari15 issues.

@patrickhousley patrickhousley merged commit 3d9f2c0 into main Jul 17, 2023
@patrickhousley patrickhousley deleted the jserrors-unwrap branch July 17, 2023 17:30
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