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-6322] Use window.open observable #3215

Merged
merged 8 commits into from
Dec 13, 2024

Conversation

nulrich
Copy link
Contributor

@nulrich nulrich commented Dec 12, 2024

Motivation

window.open instrumentation/de-instrumentation in actions collection is stacking instrumented method.

Changes

Instrument window.open only once when SDK is loading and use an observable to listen to calls.

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@codecov-commenter
Copy link

codecov-commenter commented Dec 12, 2024

Codecov Report

Attention: Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.

Project coverage is 93.33%. Comparing base (518c07a) to head (cb8f7b0).

Files with missing lines Patch % Lines
...ges/rum-core/src/domain/action/actionCollection.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3215   +/-   ##
=======================================
  Coverage   93.33%   93.33%           
=======================================
  Files         286      287    +1     
  Lines        7771     7774    +3     
  Branches     1754     1754           
=======================================
+ Hits         7253     7256    +3     
  Misses        518      518           

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

Copy link

cit-pr-commenter bot commented Dec 12, 2024

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 163.22 KiB 163.37 KiB 158 B +0.09%
Logs 56.35 KiB 56.35 KiB 0 B 0.00%
Rum Slim 111.80 KiB 111.96 KiB 158 B +0.14%
Worker 25.21 KiB 25.21 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base Average Cpu Time (ms) Local Average Cpu Time (ms) 𝚫
addglobalcontext 0.002 0.001 -0.001
addaction 0.053 0.031 -0.022
addtiming 0.001 0.001 -0.000
adderror 0.040 0.035 -0.005
startstopsessionreplayrecording 1.442 0.871 -0.571
startview 0.447 0.437 -0.011
logmessage 0.033 0.027 -0.006
🧠 Memory Performance
Action Name Base Consumption Memory (bytes) Local Consumption Memory (bytes) 𝚫 (bytes)
addglobalcontext 7.65 KiB 7.85 KiB 201 B
addaction 39.92 KiB 38.75 KiB -1205 B
addtiming 8.42 KiB 6.31 KiB -2157 B
adderror 46.76 KiB 44.82 KiB -1992 B
startstopsessionreplayrecording 6.01 KiB 5.65 KiB -373 B
startview 421.24 KiB 424.05 KiB 2.81 KiB
logmessage 40.86 KiB 41.01 KiB 156 B

🔗 RealWorld

@nulrich nulrich force-pushed the nicolas.ulrich/window-open-observable branch from 10be4bd to 0c97fdc Compare December 12, 2024 17:22
@nulrich nulrich marked this pull request as ready for review December 13, 2024 08:30
@nulrich nulrich requested a review from a team as a code owner December 13, 2024 08:30
Copy link
Contributor

@sethfowler-datadog sethfowler-datadog left a comment

Choose a reason for hiding this comment

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

LGTM! Some nits below:

packages/rum-core/src/domain/view/viewCollection.spec.ts Outdated Show resolved Hide resolved
`)
.run(async () => {
await withBrowserLogs((logs) => {
// A failing test would have a log with message "Uncaught RangeError: Maximum call stack size exceeded"
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like we should link to a Jira ticket or something with the historical context around this issue.

@nulrich nulrich changed the title Use window.open observable 🐛 Use window.open observable Dec 13, 2024
@nulrich nulrich changed the title 🐛 Use window.open observable 🐛 Use window.open observable Dec 13, 2024
@nulrich nulrich changed the title 🐛 Use window.open observable 🐛 [RUM-6322] Use window.open observable Dec 13, 2024
@nulrich nulrich merged commit 8c6c9d8 into main Dec 13, 2024
20 checks passed
@nulrich nulrich deleted the nicolas.ulrich/window-open-observable branch December 13, 2024 13:40
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.

5 participants