fix: ensure standard schemes are registered in nw service process#22867
Conversation
dd6c8f7 to
ff670d1
Compare
|
@nornagon thoughts on how to test this ? when this crash happens it doesn't seem to affect the resource loading on those custom schemes, so thats why existing test suites where passing. Only the service process goes on a loop restarting. |
Maybe I'm confused then... how is this change visible to the user? |
|
Just infinite logs from network service The registered scheme itself works fine, files are served over the protocol, renderer window.location object parses the host and other properties. And just observed that shutdown of app isn't graceful. Let me see if I can write a test that verifies app shutdown when using this api. |
ff670d1 to
cb91e5c
Compare
|
@nornagon added simple test, PTAL. |
nornagon
left a comment
There was a problem hiding this comment.
seems weird to me that the network service would function fine but continually crash..? but OK.
Co-Authored-By: Jeremy Apthorp <[email protected]>
4209b9a to
de656d6
Compare
|
Failing test is unrelated, merging. |
|
Release Notes Persisted
|
|
I have automatically backported this PR to "9-x-y", please check out #22917 |
…ectron#22867) * fix: ensure standard schemes are registered in nw service process Refs electron#20546 * chore: add test * chore: apply suggestions from code review Co-Authored-By: Jeremy Apthorp <[email protected]> Co-authored-by: Jeremy Apthorp <[email protected]>
OnRegisterCustomSchemes was implemented only on LaufeyApp (the browser process). The CefApp handed to CefExecuteProcess for every sub-process (helper.cc -> LaufeyRendererApp) did not override it, so custom standard schemes were declared only in the browser. A custom standard scheme must be registered in every process, including the network service utility process; otherwise the network service rejects navigations to it (VALIDATION_ERROR_DESERIALIZATION_FAILED on network.mojom.NetworkContext) and the page stays blank. Only built-in schemes (data:, https:) worked. Mirror LaufeyApp::OnRegisterCustomSchemes on LaufeyRendererApp so the scheme is registered in the renderer, GPU, and network-service processes too. Same fix Electron applied in electron/electron#22867. Also add an app:// case to the cef_e2e harness (it previously only exercised a data: URL, which cannot hit this bug): before, the navigation floods network.mojom.NetworkContext errors and never loads; after, it loads and the page script round-trips through a binding. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Description of Change
Crash in Network service process due to #20546 regressed after f5b9e49 .
This PR fixes by making a clear indication of how the schemes are registered in respective Browser, Renderer and Network process.
Identified while testing #20625 but ci logs in master also show the crash.
Checklist
npm testpassesRelease Notes
Notes: fix crash in network service process when using protocol.registerSchemeAsPrivileged api