-
Notifications
You must be signed in to change notification settings - Fork 44
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: JSEerrors harvest hasReplay decoration #986
Conversation
Asset Size Report
Merging this pull request will result in the following asset size changes:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #986 +/- ##
==========================================
+ Coverage 83.80% 83.87% +0.06%
==========================================
Files 153 153
Lines 7151 7149 -2
Branches 1408 1413 +5
==========================================
+ Hits 5993 5996 +3
+ Misses 988 981 -7
- Partials 170 172 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Smoke test for chrome@latest passed after last change: https://github.com/newrelic/newrelic-browser-agent/actions/runs/8741381473/job/23987270890 |
In scenarios where the SessionReplay feature was preloaded but a recording was never started, errors happening on the page would be improperly decorated with the
hasReplay
flag.Overview
This introduces a pre-harvest cross-feature communication event within the JSErrors feature. When a harvest occurs, the JSErrors feature will send out the
cfc.jserrors
event with an object containing information about the errors being harvested.The SessionReplay feature has been updated to listen to the
cfc.jserrors
event and decorate the event payload with ahasReplay
flag in the aggregate. The flag will be true only if the aggregate loaded, the aggregate has a running harvest scheduler, the aggregate has a recorder initialized, the mode is inFULL
, the aggregate is not blocked, and the aggregate is entitled to harvest.A check as been added to the JSErrors
cfc
function to check for the event data flaghasReplay
. If any of the errors being harvested has thehasReplay
flag present and truethy, but thecfc
event data is missing thehasReplay
flag or the flag is falsey, the harvest payload will be updated to remove thehasReplay
flag off all the error params objects.Note: If the
hasReplay
flag is missing in thecfc
event data, it is indicative of the SessionReplay aggregate never loading. If it is present but has a false value, one of the above checks failed in the SessionReplay feature.Related Issue(s)
https://new-relic.atlassian.net/browse/NR-260139
Testing
A wdio test was added that presents a reproducible scenario where the SessionReplay feature is preloaded but not auto started. In such a scenario, the errors harvested would always have
hasReplay
but shouldn't.