Repository navigation
fix r2d3 theme handshake null dereference (#18065) - #18092
Conversation
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.
🍎 macOS Desktop E2E · ARM64✅ All tests passed!
📥 Download Playwright report⬇️ playwright-report.zip — extract and open
2 shards · macos-26 ARM64 · commit |
🐧 Linux Server E2E · Ubuntu 24✅ All tests passed!
📥 Download Playwright report⬇️ playwright-report.zip — extract and open
2 shards · ubuntu-24.04 · commit |
🪟 Windows Desktop E2E · Server 2025 x64✅ All tests passed!
📥 Download Playwright report⬇️ playwright-report.zip — extract and open
2 shards · Windows Server 2025 x64 · commit |
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 wastest.fixme'd) with an uncaught GWT client exception:Root cause
HtmlMessageListener.registerThemeOriginImplreadspUserState_.get().theme()..., but theProvider<UserState> pUserState_field was never injected -- the@Injectconstructor took onlyProvider<UserPrefs>(stored in the now-unusedpUserPrefs_). SopUserState_has beennullsince 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
Provider<UserState>intoHtmlMessageListenerand assignpUserState_.test.fixmeguard on the r2d3 consent test so it verifies the fix on all platforms.Also in this PR
GWT_STYLE=PRETTYfor 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 thersession-runner.logattachment, 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
HtmlMessageListenerand needs separate investigation. Hence "Addresses" rather than "Fixes".Addresses #18065.