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-1518] implement a new API to stop the RUM session #2064

Merged
merged 16 commits into from
Mar 27, 2023

Conversation

BenoitZugmeyer
Copy link
Member

@BenoitZugmeyer BenoitZugmeyer commented Mar 8, 2023

Motivation

Let SDK users have more control on when RUM sessions should end.

Changes

  • light refactoring
  • implement a way to expire the session in the session manager
  • expose stopSession()

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@BenoitZugmeyer BenoitZugmeyer requested a review from a team as a code owner March 8, 2023 17:44
@@ -64,6 +65,7 @@ export function makeRumPublicApi(

let getInternalContextStrategy: StartRumResult['getInternalContext'] = () => undefined
let getInitConfigurationStrategy = (): InitConfiguration | undefined => undefined
let stopSessionStrategy: () => void = noop
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💭 thought: we didn't discuss what should happen when calling stopSession() before RUM is started. We might want to do something before GA

@BenoitZugmeyer BenoitZugmeyer changed the title ⚗✨ [RUMF-1518] implement a new API to stop the RUM session ✨ [RUMF-1518] implement a new API to stop the RUM session Mar 21, 2023
@codecov-commenter
Copy link

codecov-commenter commented Mar 21, 2023

Codecov Report

Merging #2064 (81eb6e0) into main (d55b842) will increase coverage by 0.11%.
The diff coverage is 92.10%.

@@            Coverage Diff             @@
##             main    #2064      +/-   ##
==========================================
+ Coverage   93.46%   93.58%   +0.11%     
==========================================
  Files         159      159              
  Lines        5506     5515       +9     
  Branches     1259     1262       +3     
==========================================
+ Hits         5146     5161      +15     
+ Misses        360      354       -6     
Impacted Files Coverage Δ
packages/core/src/domain/session/sessionManager.ts 100.00% <ø> (ø)
packages/rum-core/src/boot/startRum.ts 85.71% <0.00%> (-1.79%) ⬇️
packages/rum-core/src/domain/rumSessionManager.ts 90.69% <ø> (ø)
packages/rum-core/test/mockRumSessionManager.ts 94.28% <81.81%> (-5.72%) ⬇️
...ges/core/src/domain/session/oldCookiesMigration.ts 100.00% <100.00%> (ø)
...ages/core/src/domain/session/sessionCookieStore.ts 100.00% <100.00%> (ø)
packages/core/src/domain/session/sessionStore.ts 100.00% <100.00%> (ø)
packages/rum-core/src/boot/rumPublicApi.ts 93.25% <100.00%> (+0.23%) ⬆️

... and 3 files with indirect coverage changes

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

@bcaudan bcaudan self-requested a review March 22, 2023 13:33
The original `findSessionCookie` suffered from the same edge case where
the cookie is returned but its value is empty. Let's update it to the
new implementation I went for, so it simplifies its usage.
@BenoitZugmeyer BenoitZugmeyer merged commit 16787c2 into main Mar 27, 2023
@BenoitZugmeyer BenoitZugmeyer deleted the benoit/kiosk--stop-session branch March 27, 2023 13:24
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.

🙏 Start new session manually when Datadog has already initialised
4 participants