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: recordReplay will restart replays on same session page loads #1093

Merged
merged 3 commits into from
Jun 28, 2024

Conversation

cwli24
Copy link
Contributor

@cwli24 cwli24 commented Jun 27, 2024

Patch a case of recordReplay not restarting session replay. Customers can now programatically continue the session replay after a hard page navigation.

Overview

Change old smart-attempt logic to exclude SR agg from loading if existing session mode is off to always load as long as session entity itself was initialized and exists. This ensure the aggregate is around to listen for recordReplay calls which forces the start of replay regardless of existing session mode being off (as long as entitlements are valid).

Related Issue(s)

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

Testing

Run new test file w/ old build; new test will fail with mode still being 0. Run it with PR build, new test passes with mode 1.

@cwli24 cwli24 changed the title Fix: recordReplay will restart replays on same session page loads fix: recordReplay will restart replays on same session page loads Jun 27, 2024
Copy link

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.73 kB / 12.13 kB (gzip) 34.71 kB / 12.1 kB (gzip) -0.07% / -0.26% (gzip)
lite async-chunk 50.09 kB / 16.18 kB (gzip) 50.09 kB / 16.18 kB (gzip) 0% / 0% (gzip)
pro loader 55.29 kB / 18.72 kB (gzip) 55.24 kB / 18.69 kB (gzip) -0.09% / -0.14% (gzip)
pro async-chunk 96.12 kB / 28.85 kB (gzip) 96.12 kB / 28.85 kB (gzip) 0% / 0% (gzip)
spa loader 63.23 kB / 21.14 kB (gzip) 63.18 kB / 21.12 kB (gzip) -0.08% / -0.13% (gzip)
spa async-chunk 111.23 kB / 33.23 kB (gzip) 111.23 kB / 33.23 kB (gzip) 0% / 0% (gzip)
lite-polyfills loader 128.42 kB / 41.46 kB (gzip) 128.38 kB / 41.43 kB (gzip) -0.03% / -0.07% (gzip)
lite-polyfills async-chunk 63.99 kB / 18.45 kB (gzip) 63.99 kB / 18.45 kB (gzip) 0% / 0% (gzip)
pro-polyfills loader 150.62 kB / 47.69 kB (gzip) 150.57 kB / 47.66 kB (gzip) -0.03% / -0.06% (gzip)
pro-polyfills async-chunk 116.19 kB / 31.08 kB (gzip) 116.19 kB / 31.08 kB (gzip) 0% / 0% (gzip)
spa-polyfills loader 158.81 kB / 49.85 kB (gzip) 158.77 kB / 49.82 kB (gzip) -0.03% / -0.06% (gzip)
spa-polyfills async-chunk 133.16 kB / 35.78 kB (gzip) 133.16 kB / 35.78 kB (gzip) 0% / 0% (gzip)

Copy link

codecov bot commented Jun 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.62%. Comparing base (c384834) to head (61cf00f).

Current head 61cf00f differs from pull request most recent head 8fbbeb5

Please upload reports for the commit 8fbbeb5 to get more accurate results.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1093   +/-   ##
=======================================
  Coverage   87.62%   87.62%           
=======================================
  Files         162      162           
  Lines        7249     7251    +2     
  Branches     1421     1422    +1     
=======================================
+ Hits         6352     6354    +2     
  Misses        781      781           
  Partials      116      116           
Flag Coverage Δ
integration-tests 91.49% <100.00%> (ø)
unit-tests 76.43% <100.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Jun 28, 2024

Static Badge

Last ran on June 28, 2024 10:11:26 CDT
Checking merge of (61cf00f) into main (c384834)

@cwli24 cwli24 merged commit cecddbe into main Jun 28, 2024
16 checks passed
@cwli24 cwli24 deleted the patch-recordReplay branch June 28, 2024 15:28
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.

3 participants