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-175] sanitize RegExp and Event #3188

Merged
merged 2 commits into from
Dec 23, 2024

Conversation

thomas-lebeau
Copy link
Collaborator

@thomas-lebeau thomas-lebeau commented Nov 29, 2024

Motivation

Enhance serialization for Event and RegExp

Changes

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@codecov-commenter
Copy link

codecov-commenter commented Nov 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.58%. Comparing base (3485ca5) to head (c091b86).
Report is 30 commits behind head on v6.

Additional details and impacted files
@@           Coverage Diff           @@
##               v6    #3188   +/-   ##
=======================================
  Coverage   93.57%   93.58%           
=======================================
  Files         279      279           
  Lines        7475     7481    +6     
  Branches     1686     1689    +3     
=======================================
+ Hits         6995     7001    +6     
  Misses        480      480           

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

Copy link

cit-pr-commenter bot commented Nov 29, 2024

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 151.84 KiB 152.01 KiB 170 B +0.11%
Logs 50.64 KiB 50.81 KiB 170 B +0.33%
Rum Slim 102.04 KiB 102.21 KiB 170 B +0.16%
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.002 0.002 0.000
addaction 0.031 0.050 0.019
addtiming 0.001 0.001 0.000
adderror 0.041 0.045 0.005
startstopsessionreplayrecording 0.790 0.954 0.164
startview 0.984 1.234 0.251
logmessage 0.020 0.023 0.003
🧠 Memory Performance
Action Name Base Consumption Memory (bytes) Local Consumption Memory (bytes) 𝚫 (bytes)
addglobalcontext 9.15 KiB 8.08 KiB -1104 B
addaction 41.28 KiB 39.60 KiB -1711 B
addtiming 8.36 KiB 7.90 KiB -466 B
adderror 44.64 KiB 43.29 KiB -1387 B
startstopsessionreplayrecording 7.02 KiB 4.05 KiB -3042 B
startview 405.07 KiB 405.97 KiB 915 B
logmessage 41.87 KiB 43.94 KiB 2.07 KiB

🔗 RealWorld

@thomas-lebeau thomas-lebeau force-pushed the thomas.lebeau/improved-serialization branch from f6f2e84 to 3e6968c Compare November 29, 2024 16:35
@thomas-lebeau thomas-lebeau marked this pull request as ready for review December 10, 2024 07:58
@thomas-lebeau thomas-lebeau requested a review from a team as a code owner December 10, 2024 07:58
@thomas-lebeau thomas-lebeau changed the title ✨ sanitize RegExp and Event ✨ [RUM-175] sanitize RegExp and Event Dec 10, 2024
*/
function sanitizeObjects(value: object) {
function sanitizeObjects(value: object): string | sanitizedEvent {
try {
// Handle events - Keep a simple implementation to avoid breaking changes
Copy link
Collaborator

Choose a reason for hiding this comment

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

❓ question: Maybe we could remove this comment now?‏

Comment on lines 242 to 243
currentTarget: event.currentTarget !== null ? (sanitizeObjects(event.currentTarget) as string) : null,
target: event.target !== null ? (sanitizeObjects(event.target) as string) : null,
Copy link
Collaborator

Choose a reason for hiding this comment

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

🥜 nitpick: ‏Simplification:

Suggested change
currentTarget: event.currentTarget !== null ? (sanitizeObjects(event.currentTarget) as string) : null,
target: event.target !== null ? (sanitizeObjects(event.target) as string) : null,
currentTarget: event.currentTarget ? (sanitizeObjects(event.currentTarget) as string) : null,
target: event.target ? (sanitizeObjects(event.target) as string) : null,

@thomas-lebeau thomas-lebeau merged commit 4d8d86d into v6 Dec 23, 2024
17 checks passed
@thomas-lebeau thomas-lebeau deleted the thomas.lebeau/improved-serialization branch December 23, 2024 07:21
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