newrelic / newrelic-browser-agent

New Relic Browser Agent
Apache License 2.0
77 stars 40 forks source link

fix: dedup pre-load ajax requests #1081

Closed patrickhousley closed 3 months ago

patrickhousley commented 3 months ago

Fixing an issue where ajax requests made prior to the page load event would be reported as part of the SPA data and as standard ajax events.

Overview

Changed the load order of the features so that the SPA feature loaded before the ajax feature. This way, the SPA feature has a chance to decorate the ajax data with an interaction ID before the ajax feature processes it.

Related Issue(s)

https://new-relic.atlassian.net/browse/NR-274140

Testing

github-actions[bot] commented 3 months ago

Static Badge

Last ran on June 24, 2024 16:18:11 CDT Checking merge of (528f5e1822b11614283ee28fddd72a07d4c925fc) into main (f5b9bc9e6996ca3f22331f39184373e402130124)

github-actions[bot] commented 3 months ago

Asset Size Report

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

Agent Asset Previous Size New Size Diff
lite loader 34.69 kB / 12.12 kB (gzip) 34.69 kB / 12.12 kB (gzip) 0% / 0.01% (gzip)
lite async-chunk 50.03 kB / 16.16 kB (gzip) 50.03 kB / 16.16 kB (gzip) 0% / 0% (gzip)
pro loader 55.25 kB / 18.71 kB (gzip) 55.25 kB / 18.71 kB (gzip) 0.01% / 0.01% (gzip)
pro async-chunk 95.93 kB / 28.81 kB (gzip) 95.93 kB / 28.81 kB (gzip) 0% / 0% (gzip)
spa loader 63.19 kB / 21.15 kB (gzip) 63.19 kB / 21.15 kB (gzip) 0.01% / 0.01% (gzip)
spa async-chunk 111.04 kB / 33.18 kB (gzip) 111.04 kB / 33.18 kB (gzip) 0% / 0% (gzip)
lite-polyfills loader 128.4 kB / 41.45 kB (gzip) 128.4 kB / 41.45 kB (gzip) 0% / 0% (gzip)
lite-polyfills async-chunk 63.93 kB / 18.43 kB (gzip) 63.93 kB / 18.43 kB (gzip) 0% / 0% (gzip)
pro-polyfills loader 150.59 kB / 47.69 kB (gzip) 150.59 kB / 47.69 kB (gzip) 0% / 0% (gzip)
pro-polyfills async-chunk 116.08 kB / 31.03 kB (gzip) 116.08 kB / 31.03 kB (gzip) 0% / 0% (gzip)
spa-polyfills loader 158.78 kB / 49.85 kB (gzip) 158.79 kB / 49.85 kB (gzip) 0% / 0% (gzip)
spa-polyfills async-chunk 133.04 kB / 35.73 kB (gzip) 133.04 kB / 35.73 kB (gzip) 0% / 0% (gzip)
codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.67%. Comparing base (f5b9bc9) to head (528f5e1).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1081 +/- ## ========================================== - Coverage 87.68% 87.67% -0.02% ========================================== Files 162 162 Lines 7246 7246 Branches 1419 1419 ========================================== - Hits 6354 6353 -1 - Misses 776 777 +1 Partials 116 116 ``` | [Flag](https://app.codecov.io/gh/newrelic/newrelic-browser-agent/pull/1081/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | Coverage Δ | | |---|---|---| | [integration-tests](https://app.codecov.io/gh/newrelic/newrelic-browser-agent/pull/1081/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `91.57% <100.00%> (-0.03%)` | :arrow_down: | | [unit-tests](https://app.codecov.io/gh/newrelic/newrelic-browser-agent/pull/1081/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `76.43% <100.00%> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.