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

💥 [RUM 6075] Save anonymous id in session cookie #2985

Merged
merged 24 commits into from
Dec 2, 2024

Conversation

cy-moi
Copy link
Contributor

@cy-moi cy-moi commented Sep 11, 2024

Motivation

Test saving anonymous id in session cookie on org2.

Changes

Add anonymous id to session cookie behind a feature flag.

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@cy-moi cy-moi changed the title [RUM 6075] device in session cookie [RUM 6075] Save device id in session cookie Sep 11, 2024
Copy link

cit-pr-commenter bot commented Sep 11, 2024

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 152.01 KiB 152.52 KiB 521 B +0.33%
Logs 50.80 KiB 51.24 KiB 452 B +0.87%
Rum Slim 102.21 KiB 102.72 KiB 521 B +0.50%
Worker 25.16 KiB 25.16 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base Average Cpu Time (ms) Local Average Cpu Time (ms) 𝚫
addglobalcontext 0.001 0.004 0.003
addaction 0.032 0.152 0.119
addtiming 0.001 0.002 0.000
adderror 0.039 0.158 0.119
startstopsessionreplayrecording 1.103 2.345 1.242
startview 1.168 4.240 3.072
logmessage 0.021 0.055 0.034
🧠 Memory Performance
Action Name Base Consumption Memory (bytes) Local Consumption Memory (bytes) 𝚫 (bytes)
addglobalcontext 7.58 KiB 7.23 KiB -357 B
addaction 37.72 KiB 38.05 KiB 338 B
addtiming 6.72 KiB 6.27 KiB -455 B
adderror 43.16 KiB 41.06 KiB -2149 B
startstopsessionreplayrecording 3.74 KiB 5.31 KiB 1.57 KiB
startview 404.95 KiB 405.31 KiB 367 B
logmessage 39.23 KiB 39.07 KiB -158 B

🔗 RealWorld

@codecov-commenter
Copy link

codecov-commenter commented Sep 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.63%. Comparing base (746252d) to head (03fcf95).
Report is 50 commits behind head on v6.

Additional details and impacted files
@@            Coverage Diff             @@
##               v6    #2985      +/-   ##
==========================================
+ Coverage   93.61%   93.63%   +0.01%     
==========================================
  Files         279      280       +1     
  Lines        7473     7491      +18     
  Branches     1690     1702      +12     
==========================================
+ Hits         6996     7014      +18     
  Misses        477      477              

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

@cy-moi cy-moi force-pushed the congyao/RUM-6075-device-in-session-cookie branch from 48ecdd4 to ebbd968 Compare September 16, 2024 16:05
@cy-moi cy-moi force-pushed the congyao/RUM-6075-device-in-session-cookie branch from 1ca13a8 to c05301e Compare September 17, 2024 12:49
@cy-moi cy-moi changed the base branch from main to v6 October 11, 2024 09:45
@cy-moi cy-moi changed the title [RUM 6075] Save device id in session cookie ✨ [RUM 6075] Save device id in session cookie Oct 11, 2024
@cy-moi cy-moi force-pushed the congyao/RUM-6075-device-in-session-cookie branch from 6c2171e to a620dfb Compare October 11, 2024 09:57
@cy-moi cy-moi changed the title ✨ [RUM 6075] Save device id in session cookie ✨ [RUM 6075] Save anonymous id in session cookie Oct 11, 2024
@cy-moi cy-moi marked this pull request as ready for review October 11, 2024 11:47
@cy-moi cy-moi requested a review from a team as a code owner October 11, 2024 11:47
Clean up imports

Clean up
@cy-moi cy-moi force-pushed the congyao/RUM-6075-device-in-session-cookie branch from 146ba07 to b0d4183 Compare October 15, 2024 15:56
!commonContext.user.anonymous_id
) {
const { type } = configuration.sessionStoreStrategyType ?? { type: 'LocalStorage' }
commonContext.user.anonymous_id = retrieveAnonymousId(type)
Copy link
Member

Choose a reason for hiding this comment

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

💬 suggestion: ‏a bit related to my previous comment, but we should probably be able to do something like:

Suggested change
commonContext.user.anonymous_id = retrieveAnonymousId(type)
commonContext.user.anonymous_id = session.getAnonymousUserId()

@cy-moi cy-moi force-pushed the congyao/RUM-6075-device-in-session-cookie branch from 4462574 to 66e5138 Compare November 25, 2024 15:11
@cy-moi cy-moi changed the title ✨ [RUM 6075] Save anonymous id in session cookie 💥 [RUM 6075] Save anonymous id in session cookie Nov 26, 2024
@cy-moi cy-moi merged commit 36d5260 into v6 Dec 2, 2024
16 checks passed
@cy-moi cy-moi deleted the congyao/RUM-6075-device-in-session-cookie branch December 2, 2024 15:02
@cy-moi cy-moi restored the congyao/RUM-6075-device-in-session-cookie branch December 9, 2024 16:04
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