Skip to content

✨ enable partial view updates by default for CDN users without a proxy - #5000

Draft
mormubis wants to merge 9 commits into
mainfrom
adlrb/pvu-enable-by-default
Draft

✨ enable partial view updates by default for CDN users without a proxy#5000
mormubis wants to merge 9 commits into
mainfrom
adlrb/pvu-enable-by-default

Conversation

@mormubis

@mormubis mormubis commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Motivation

Partial view updates have been behind betaEnableViewUpdates since #4833. This is the Sept 7 step of the Road to GA: enable it by default where we know it's safe.

CDN users always run the latest bundle, so we can roll back by shipping a new version. npm users pin a version, so they opt in explicitly. proxy users stay off too, a proxy may not forward the view_update event type yet.

Changes

betaEnableViewUpdates defaults to true on CDN builds without proxy, and false everywhere else. An explicit value from the user always wins.

The schema default only takes static values, so I removed it from the field and resolve it in validateAndBuildRumConfiguration instead, next to the other post-processed options. That's the part worth a look: with default: false you can't tell "passed false" from "passed nothing", both come out as false. Without the default an unset option is undefined, so ?? can fill it in and an explicit false survives.

Telemetry now reports the resolved value instead of the raw one. Otherwise every defaulted user shows up as undefined and we can't follow the rollout.

CDN vs npm comes from __BUILD_ENV__SDK_SETUP__, declared locally in configuration.ts like the other build-env consumers do. Unit tests are bundled as cdn, so the npm side of the default isn't covered by unit tests, only by e2e and by reading the code.

Test instructions

  1. yarn dev and open the sandbox. It sets proxy: '/proxy', so the RUM configuration telemetry should report beta_enable_view_updates: false.
  2. Comment out proxy in sandbox/index.html and reload. It should now be true. Requests fail auth without the proxy, that's expected, the configuration event still goes out.
  3. yarn test:unit --spec packages/browser-rum-core/src/domain/configuration/configuration.spec.ts for the proxy/no-proxy and explicit-value cases.

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change. The PVU e2e tests already set the flag explicitly, and every e2e page injects proxy, so they cover the disabled path.
  • Updated documentation and/or relevant AGENTS.md file. The option's JSDoc is updated here, public docs live in the docs repo.

@mormubis
mormubis requested a review from a team as a code owner August 31, 2026 10:36
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-31T10:41:26.911337Z 5eb08c1 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Aug 31, 2026

Copy link
Copy Markdown

Tests

All CI checks and tests passed.

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 0.00%
Overall Coverage: 77.03% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: f99fe23 | Docs | View more details | Give us feedback!

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Aug 31, 2026

Copy link
Copy Markdown

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 181.63 KiB 181.71 KiB +85 B +0.05%
Rum Profiler 8.43 KiB 8.43 KiB 0 B 0.00%
Rum Recorder 25.32 KiB 25.32 KiB 0 B 0.00%
Logs 57.93 KiB 57.93 KiB 0 B 0.00%
Rum Salesforce N/A 139.77 KiB N/A N/A N/A
Rum Slim 139.68 KiB 139.77 KiB +85 B +0.06%
Worker 22.96 KiB 22.96 KiB 0 B 0.00%
Rum Shopify N/A 206.07 KiB N/A N/A N/A
Rum-shopify Profiler N/A 8.43 KiB N/A N/A N/A
Rum-shopify Recorder N/A 3.74 KiB N/A N/A N/A

@mormubis
mormubis marked this pull request as draft August 31, 2026 10:40
Reverts the getSdkSetup accessor and its browser-core export. rum-core now declares
__BUILD_ENV__SDK_SETUP__ locally, like the eight existing __BUILD_ENV__SDK_VERSION__
consumers. Drops the four npm-branch tests, which are unreachable under Karma because
webpack.base.ts pins setup: 'cdn'.

Also fixes prettier on the beta_enable_view_updates line.
Both declares of __BUILD_ENV__SDK_SETUP__ now read 'npm' | 'cdn', matching the
setup argument of getBuildEnvDefines. With the previous 'string' type a typo like
=== 'CDN' would compile and silently disable the feature.
trackLongTasks: { type: 'boolean', default: true, strict: false },
trackViewsManually: { type: 'boolean', default: false, strict: false },
betaEnableViewUpdates: { type: 'boolean', default: false },
betaEnableViewUpdates: { type: 'boolean' },

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I removed the default. With default: false you can't tell if the user passed false or didn't pass anything, both end up as false after validation. So the default is resolved in validateAndBuildRumConfiguration instead.

The intersection already resolves it: (boolean | undefined) & boolean is boolean, and
the required member wins over the optional one. Only allowedTracingUrls needs the Omit,
because its schema type and resolved type are incompatible.
sdk_setup is merged in via combine() and cast to TelemetryEvent['telemetry'], so the
type is never checked there. The narrow only pays off in rum-core where the value is
compared against 'cdn'. Leaving telemetry.ts untouched avoids a declare that can go
stale if a third setup is ever added.
…global

The narrow only guarded a typo in === 'cdn', which the tests already catch. string
matches the telemetry declare and the eight __BUILD_ENV__SDK_VERSION__ ones.
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.

1 participant