Skip to content

fix r2d3 theme handshake null dereference (#18065) - #18092

Merged
kevinushey merged 2 commits into
mainfrom
bugfix/18065-r2d3-theme-handshake-npe
Jun 30, 2026
Merged

kevinushey merged 2 commits into
mainfrom
bugfix/18065-r2d3-theme-handshake-npe

Conversation

@kevinushey

Copy link
Copy Markdown
Collaborator

Problem

The Playwright test r2d3_preview_security.test.ts -> "preview runs the command in the console after the user consents" fails on Linux Desktop CI (and previously Windows CI / Linux Server, where it was test.fixme'd) with an uncaught GWT client exception:

(TypeError) Cannot read properties of null (reading 'pYc')
  HtmlMessageListener.java#133 registerThemeOriginImpl
  HtmlMessageListener.java#137 registerThemeOrigin   <- $wnd "message" listener

Root cause

HtmlMessageListener.registerThemeOriginImpl reads pUserState_.get().theme()..., but the Provider<UserState> pUserState_ field was never injected -- the @Inject constructor took only Provider<UserPrefs> (stored in the now-unused pUserPrefs_). So pUserState_ has been null since 2019 (commit a6e6bf5). When an r2d3 widget's iframe posts its "ontheme" message, the handler throws -- which also meant r2d3 widgets never received the editor theme.

It stayed latent because uncaught client exceptions were silently swallowed before the e2e exception-capture fixture, and the timing only surfaces the throw within the test window on slower/non-focused CI runs (hence "passes" on macOS).

Fix

  • Inject Provider<UserState> into HtmlMessageListener and assign pUserState_.
  • Remove the obsolete test.fixme guard on the r2d3 consent test so it verifies the fix on all platforms.

Also in this PR

  • Enable GWT_STYLE=PRETTY for the Ubuntu Desktop and Server e2e build workflows (folded into the GWT output cache key), matching the macOS/Windows workflows. The Linux workflows added in Add Ubuntu 24 Linux Desktop E2E automation (PR, scheduled, cache seed) #18081 were missing it, which is why this Linux failure arrived with obfuscated symbols. (The decoded stack above actually came from the rsession-runner.log attachment, which source-maps frames regardless.)

Scope note

#18065 covers both the SQL and r2d3 preview-consent variants. This PR fixes only the r2d3 variant; the SQL variant (Server-only) does not go through HtmlMessageListener and needs separate investigation. Hence "Addresses" rather than "Fixes".

Addresses #18065.

HtmlMessageListener.registerThemeOriginImpl reads pUserState_.get(), but the
Provider<UserState> field was never injected (the @Inject constructor took only
Provider<UserPrefs>), so it was null since 2019. When an r2d3 widget iframe
posts its 'ontheme' message the handler threw an uncaught TypeError, which also
meant r2d3 widgets never received the editor theme. Inject Provider<UserState>
and assign pUserState_.

Also enable GWT_STYLE=PRETTY for the Ubuntu Desktop and Server e2e build
workflows (folded into the GWT output cache key) so Linux client-exception
stacks are decodable, matching the macOS and Windows workflows; the Linux
workflows added in #18081 had been missing it. Remove the now-obsolete
test.fixme guard on the r2d3 consent test so it verifies the fix.
@kevinushey kevinushey added this to the 2026.07 (Pacific Dogwood) milestone Jun 30, 2026
@kevinushey
kevinushey merged commit 7557f1a into main Jun 30, 2026
1 check passed
@kevinushey
kevinushey deleted the bugfix/18065-r2d3-theme-handshake-npe branch June 30, 2026 00:53
@github-actions

Copy link
Copy Markdown

🍎 macOS Desktop E2E · ARM64

✅ All tests passed!

████████████████████ 100% pass rate

✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
406 0 16 1
📥 Download Playwright report

⬇️ playwright-report.zip — extract and open index.html

Includes screenshots, traces, and step-by-step details for every test. Expires in 15 days.


2 shards · macos-26 ARM64 · commit baa38c1313c7e8e6a1abb1b9db982053c1de6149 · Run #27

@github-actions

Copy link
Copy Markdown

🐧 Linux Server E2E · Ubuntu 24

✅ All tests passed!

████████████████████ 100% pass rate

✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
396 0 20 2
📥 Download Playwright report

⬇️ playwright-report.zip — extract and open index.html

Includes screenshots, traces, and step-by-step details for every test. Expires in 15 days.


2 shards · ubuntu-24.04 · commit baa38c1313c7e8e6a1abb1b9db982053c1de6149 · Run #27

@github-actions

Copy link
Copy Markdown

🪟 Windows Desktop E2E · Server 2025 x64

✅ All tests passed!

████████████████████ 100% pass rate

✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
415 0 10 0
📥 Download Playwright report

⬇️ playwright-report.zip — extract and open index.html

Includes screenshots, traces, and step-by-step details for every test. Expires in 15 days.


2 shards · Windows Server 2025 x64 · commit baa38c1313c7e8e6a1abb1b9db982053c1de6149 · Run #27

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