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

♻️ [RUMF-1015] use the url corresponding to the start of the event #1063

Merged
merged 7 commits into from
Sep 23, 2021

Conversation

bcaudan
Copy link
Contributor

@bcaudan bcaudan commented Sep 21, 2021

Motivation

With the introduction of manual view tracking (#924), the creation of a view can be decoupled from URL changes.
In the case of a URL change occurring just before the end of a view, the view URL could wrongly be updated with the new location.

Previous behavior:

  • view events: URL updated during the lifecycle of the view
  • other events: URL corresponding to the end of the event

New behavior:

  • use the URL corresponding to the start of the event

Changes

  • Introduce UrlContexts to store URL states history
  • Use UrlContexts from assembly to retrieve URL and referrer
  • Simplify ContextHistory since we no more need to dynamically generate the current context

Testing

Unit, manually


I have gone over the contributing documentation.

@codecov-commenter
Copy link

codecov-commenter commented Sep 21, 2021

Codecov Report

Merging #1063 (0ca461a) into main (a4c60e6) will increase coverage by 0.20%.
The diff coverage is 96.55%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1063      +/-   ##
==========================================
+ Coverage   89.06%   89.27%   +0.20%     
==========================================
  Files          88       89       +1     
  Lines        4135     4148      +13     
  Branches      946      948       +2     
==========================================
+ Hits         3683     3703      +20     
+ Misses        452      445       -7     
Impacted Files Coverage Δ
packages/core/src/tools/utils.ts 87.08% <ø> (ø)
packages/rum-core/src/rawRumEvent.types.ts 100.00% <ø> (ø)
packages/rum-core/src/boot/startRum.ts 37.93% <50.00%> (+2.21%) ⬆️
packages/rum-core/src/domain/assembly.ts 96.42% <100.00%> (+0.06%) ⬆️
packages/rum-core/src/domain/contextHistory.ts 100.00% <100.00%> (ø)
packages/rum-core/src/domain/internalContext.ts 90.00% <100.00%> (+1.11%) ⬆️
packages/rum-core/src/domain/parentContexts.ts 100.00% <100.00%> (ø)
.../src/domain/rumEventsCollection/view/trackViews.ts 97.87% <100.00%> (+1.61%) ⬆️
packages/rum-core/src/domain/urlContexts.ts 100.00% <100.00%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a4c60e6...0ca461a. Read the comment docs.

@bcaudan bcaudan marked this pull request as ready for review September 21, 2021 08:54
@bcaudan bcaudan requested review from a team as code owners September 21, 2021 08:54
@bcaudan bcaudan merged commit 9bcf433 into main Sep 23, 2021
@bcaudan bcaudan deleted the bcaudan/views-url branch September 23, 2021 09:01
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.

4 participants