Skip to content

♻️ refactor modifiable field paths in rum assembly#4687

Merged
BenoitZugmeyer merged 1 commit into
mainfrom
benoit/simplify-rum-modifiable-fields
May 28, 2026
Merged

♻️ refactor modifiable field paths in rum assembly#4687
BenoitZugmeyer merged 1 commit into
mainfrom
benoit/simplify-rum-modifiable-fields

Conversation

@BenoitZugmeyer
Copy link
Copy Markdown
Member

@BenoitZugmeyer BenoitZugmeyer commented May 27, 2026

Motivation

simplify maintenance of beforeSend modifiable fields and reduce bundle size a bit.

Changes

  • factor shared modifiable paths into one common constant
  • define per-event modifiable paths in a single static map
  • remove unnecessary RumEventType.VIEW_UPDATE variant

Test instructions

  1. Start the sandbox with yarn dev.
  2. Set beforeSend to modify allowed fields (for example view.url or error.message) and verify sent events are updated.
  3. Try modifying a non-allowed field and verify it is not applied.
  4. Return false in beforeSend for a non-view event (dropped) and for a view event (not dropped).

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

move shared beforeSend modifiable paths into a common constant and define
event-specific paths in a single static map.

this removes duplicated per-event setup in startRumAssembly and keeps the
allowed field list easier to maintain without changing behavior.
@BenoitZugmeyer BenoitZugmeyer marked this pull request as ready for review May 27, 2026 16:40
@BenoitZugmeyer BenoitZugmeyer requested a review from a team as a code owner May 27, 2026 16:40
@cit-pr-commenter-54b7da
Copy link
Copy Markdown

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 175.47 KiB 175.36 KiB -113 B -0.06%
Rum Profiler 8.08 KiB 8.08 KiB 0 B 0.00%
Rum Recorder 21.23 KiB 21.23 KiB 0 B 0.00%
Logs 57.01 KiB 57.01 KiB 0 B 0.00%
Rum Slim 133.08 KiB 132.97 KiB -114 B -0.08%
Worker 22.99 KiB 22.99 KiB 0 B 0.00%

🔗 RealWorld

@datadog-datadog-prod-us1
Copy link
Copy Markdown

datadog-datadog-prod-us1 Bot commented May 27, 2026

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 76.56% (-0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 77f4a4d | Docs | Datadog PR Page | Give us feedback!

@BenoitZugmeyer BenoitZugmeyer merged commit 662bd0a into main May 28, 2026
33 checks passed
@BenoitZugmeyer BenoitZugmeyer deleted the benoit/simplify-rum-modifiable-fields branch May 28, 2026 07:49
@github-actions github-actions Bot locked and limited conversation to collaborators May 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants