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: Address bug affecting XHR harvest re-schedule #561

Merged
merged 3 commits into from
May 31, 2023

Conversation

bjfield
Copy link
Contributor

@bjfield bjfield commented May 31, 2023

A early return condition in the harvest rescheduling logic in version 1.233.0 was preventing Ajax event harvest from being rescheduled in cases where no data had accumulated.

Overview

This PR addresses a problem where, once the harvest scheduler runs for the Ajax feature and the Ajax feature has no accumulated data, the Ajax feature no longer performs future harvests. The issue appears to be line 92 in the harvest scheduler where it early-returns when there is no data to send, but does not schedule the next harvest.

Related Issue(s)

NEWRELIC-8876

Testing

  • All tests should run.
  • npm test src/common/harvest/harvest-scheduler.test.js
  • Manual verification of event harvest behavior should be confirmed.

@github-actions
Copy link

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.27 kB / 17.52 kB (gzip) 51.27 kB / 17.52 kB (gzip) -0% / -0% (gzip)
nr-loader-full.min 45.35 kB / 15.72 kB (gzip) 45.35 kB / 15.73 kB (gzip) -0% / +0.01% (gzip)
nr-loader-rum.min 26.56 kB / 9.81 kB (gzip) 26.56 kB / 9.81 kB (gzip) -0% / -0% (gzip)
nr-loader-spa-polyfills.min 124.19 kB / 39.8 kB (gzip) 124.19 kB / 39.8 kB (gzip) -0% / +0% (gzip)
nr-loader-full-polyfills.min 116.69 kB / 37.86 kB (gzip) 116.69 kB / 37.86 kB (gzip) -0% / +0% (gzip)
nr-loader-rum-polyfills.min 94.97 kB / 31.47 kB (gzip) 94.97 kB / 31.47 kB (gzip) -0% / -0% (gzip)
nr-loader-worker.min 41.42 kB / 14.38 kB (gzip) 41.42 kB / 14.38 kB (gzip) -0% / +0.01% (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.35 kB / 17.39 kB (gzip) 51.35 kB / 17.39 kB (gzip) -0% / -0% (gzip)
Custom Lite Agent 26.66 kB / 9.72 kB (gzip) 26.66 kB / 9.72 kB (gzip) -0% / -0% (gzip)
Custom Pro Agent 45.35 kB / 15.55 kB (gzip) 45.35 kB / 15.55 kB (gzip) -0% / -0% (gzip)
Custom SPA Agent 51.23 kB / 17.38 kB (gzip) 51.23 kB / 17.38 kB (gzip) -0% / -0% (gzip)
Worker Agent 301.79 kB / 93.6 kB (gzip) 301.84 kB / 93.6 kB (gzip) +0.01% / +0% (gzip)
Other Standard CDN Assets

Released Assets

Asset Name Asset Size
recorder.b9a5173b.min.js 166.07 kB / 52.31 kB (gzip)
spa-aggregate.af7499d1.min.js 18.61 kB / 6.62 kB (gzip)
286.590f130a.min.js 13.96 kB / 5.19 kB (gzip)
page_view_timing-aggregate.460e995b.min.js 12.7 kB / 4.64 kB (gzip)
page_view_event-aggregate.aa8faac3.min.js 11.25 kB / 4.19 kB (gzip)
862.bc7720da.min.js 10.82 kB / 4.3 kB (gzip)
session_trace-aggregate.e9297121.min.js 8.11 kB / 3.07 kB (gzip)
compressor.92c94011.min.js 7.09 kB / 3.57 kB (gzip)
jserrors-aggregate.cf894689.min.js 7.07 kB / 2.75 kB (gzip)
metrics-aggregate.ec8522db.min.js 6.22 kB / 2.06 kB (gzip)
ajax-aggregate.3d71ccdd.min.js 4.81 kB / 2.22 kB (gzip)
session_replay-aggregate.c104eaa2.min.js 4.24 kB / 1.66 kB (gzip)
async-api.6ec4d8b5.min.js 3 kB / 1.49 kB (gzip)
page_action-aggregate.4232b7dc.min.js 2.42 kB / 1.04 kB (gzip)
session-manager.9add1ca0.min.js 2.23 kB / 1.03 kB (gzip)
lazy-feature-loader.e269e202.min.js 1.11 kB / 495 B (gzip)

Built Assets

Asset Name Asset Size
recorder.b9a5173b.min.js 166.07 kB / 52.31 kB (gzip)
spa-aggregate.af7499d1.min.js 18.61 kB / 6.62 kB (gzip)
286.590f130a.min.js 13.96 kB / 5.19 kB (gzip)
page_view_timing-aggregate.460e995b.min.js 12.7 kB / 4.64 kB (gzip)
page_view_event-aggregate.aa8faac3.min.js 11.25 kB / 4.19 kB (gzip)
862.80c3b04d.min.js 10.86 kB / 4.31 kB (gzip)
session_trace-aggregate.e9297121.min.js 8.11 kB / 3.07 kB (gzip)
compressor.92c94011.min.js 7.09 kB / 3.57 kB (gzip)
jserrors-aggregate.cf894689.min.js 7.07 kB / 2.75 kB (gzip)
metrics-aggregate.ec8522db.min.js 6.22 kB / 2.06 kB (gzip)
ajax-aggregate.3d71ccdd.min.js 4.81 kB / 2.22 kB (gzip)
session_replay-aggregate.c104eaa2.min.js 4.24 kB / 1.66 kB (gzip)
async-api.6ec4d8b5.min.js 3 kB / 1.49 kB (gzip)
page_action-aggregate.4232b7dc.min.js 2.42 kB / 1.04 kB (gzip)
session-manager.9add1ca0.min.js 2.23 kB / 1.03 kB (gzip)
lazy-feature-loader.e269e202.min.js 1.11 kB / 495 B (gzip)
Other Polyfill CDN Assets

Released Assets

Asset Name Asset Size
recorder.b9a5173b-es5.min.js 166.76 kB / 52.35 kB (gzip)
nr-polyfills.min.js 52.15 kB / 17.95 kB (gzip)
compressor.39f21c15-es5.min.js 30.02 kB / 11.29 kB (gzip)
spa-aggregate.7b139e73-es5.min.js 19.54 kB / 6.79 kB (gzip)
286.fdfd5b74-es5.min.js 17.33 kB / 6.08 kB (gzip)
862.51ca5a87-es5.min.js 14.54 kB / 5.23 kB (gzip)
page_view_timing-aggregate.38df047a-es5.min.js 13.43 kB / 4.8 kB (gzip)
session_replay-aggregate.b02667fa-es5.min.js 13.1 kB / 4.91 kB (gzip)
page_view_event-aggregate.6745a9d4-es5.min.js 11.67 kB / 4.3 kB (gzip)
session_trace-aggregate.de285fda-es5.min.js 10.71 kB / 3.95 kB (gzip)
jserrors-aggregate.fcf95e2d-es5.min.js 7.66 kB / 2.95 kB (gzip)
metrics-aggregate.b3891231-es5.min.js 5.4 kB / 1.92 kB (gzip)
ajax-aggregate.6d31f752-es5.min.js 5.3 kB / 2.36 kB (gzip)
async-api.d7b8e452-es5.min.js 4.13 kB / 2.01 kB (gzip)
page_action-aggregate.71e2b446-es5.min.js 2.83 kB / 1.22 kB (gzip)
session-manager.c774af16-es5.min.js 2.4 kB / 1.06 kB (gzip)
lazy-feature-loader.e789e12f-es5.min.js 1.14 kB / 507 B (gzip)

Built Assets

Asset Name Asset Size
recorder.b9a5173b-es5.min.js 166.76 kB / 52.35 kB (gzip)
nr-polyfills.min.js 52.15 kB / 17.95 kB (gzip)
compressor.39f21c15-es5.min.js 30.02 kB / 11.29 kB (gzip)
spa-aggregate.7b139e73-es5.min.js 19.54 kB / 6.79 kB (gzip)
286.fdfd5b74-es5.min.js 17.33 kB / 6.08 kB (gzip)
862.467dc7f4-es5.min.js 14.58 kB / 5.24 kB (gzip)
page_view_timing-aggregate.38df047a-es5.min.js 13.43 kB / 4.8 kB (gzip)
session_replay-aggregate.b02667fa-es5.min.js 13.1 kB / 4.91 kB (gzip)
page_view_event-aggregate.6745a9d4-es5.min.js 11.67 kB / 4.3 kB (gzip)
session_trace-aggregate.de285fda-es5.min.js 10.71 kB / 3.95 kB (gzip)
jserrors-aggregate.fcf95e2d-es5.min.js 7.66 kB / 2.95 kB (gzip)
metrics-aggregate.b3891231-es5.min.js 5.4 kB / 1.92 kB (gzip)
ajax-aggregate.6d31f752-es5.min.js 5.3 kB / 2.36 kB (gzip)
async-api.d7b8e452-es5.min.js 4.13 kB / 2.01 kB (gzip)
page_action-aggregate.71e2b446-es5.min.js 2.83 kB / 1.22 kB (gzip)
session-manager.c774af16-es5.min.js 2.4 kB / 1.06 kB (gzip)
lazy-feature-loader.e789e12f-es5.min.js 1.14 kB / 507 B (gzip)

@codecov-commenter
Copy link

Codecov Report

Merging #561 (a9b4ce8) into main (5046cb0) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main     #561      +/-   ##
==========================================
- Coverage   19.97%   19.95%   -0.02%     
==========================================
  Files         132      132              
  Lines        4326     4329       +3     
  Branches     1103     1104       +1     
==========================================
  Hits          864      864              
- Misses       2735     2737       +2     
- Partials      727      728       +1     
Impacted Files Coverage Δ
src/common/harvest/harvest-scheduler.js 0.00% <0.00%> (ø)

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

@cwli24 cwli24 added bug Something isn't working small Small Engineering Effort Next Release labels May 31, 2023
@bjfield bjfield marked this pull request as ready for review May 31, 2023 19:56
@bjfield bjfield merged commit cd2dc90 into main May 31, 2023
@bjfield bjfield deleted the fix-early-xhr-return branch May 31, 2023 20:06
@bjfield bjfield changed the title fix: Address early return preempting XHR harvest re-schedule fix: Address bug affecting XHR harvest re-schedule May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working small Small Engineering Effort
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants