Skip to content

[v3/webview2] Audit: transient COM errors in runtime paths exit the process via errorCallback #5580

Description

@leaanthony

Background

Chromium.errorCallback logs and then calls os.Exit(1). That is appropriate while the WebView2 environment/controller is being created (the app cannot function without it), but chromium.go routes runtime COM errors through the same path — so any transient failure after startup kills the whole application.

This single pattern has now caused three independent crash reports, each fixed individually on the #5568 branch:

Audit of the remaining runtime sites (31 total errorCallback calls)

Defensibly fatal — init path (~20 sites): Embed, environment/controller creation callbacks, controller setup (lines ~172–392). No change proposed.

Disproportionate — runtime paths (~11 sites):

Method Failure consequence today Proposed
Resize/GetClientRect exit during teardown/DPI churn log + skip frame
Navigate / NavigateToString exit return/log error
Init (AddScriptToExecuteOnDocumentCreated) exit log
MessageReceivedTryGetWebMessageAsString a malformed message kills the app log + drop message
SetBackgroundColour exit log
PermissionRequested (GetPermissionKind/PutState) exit log + default-deny
AddWebResourceRequestedFilter exit log
PutZoomFactor exit log

Proposed direction

Once #5568 lands (which establishes the pattern for Focus/Eval), convert the remaining runtime sites to non-fatal logging in a follow-up PR, keeping fatal behaviour only for the init path. Each conversion is mechanical; the audit above is the work list.

Filed from the triage loop so the work list isn't lost — the per-site line numbers are current as of master @ alpha.99.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingP2Medium priorityWindowsv3

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions