wordpress-mobile / wordpress-mobile/GutenbergKit

Android: a WebView renderer crash kills the host app process

Open
#643 0 comments 0 reactions 1 assignee View on GitHub

@dcalhoun is already working on this.

Since Sep 9, 2026.

[Type] Bug Android Gutenberg
Dominant language
JavaScript
Stars
29
Forks
6
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Description

GutenbergView never overrides WebViewClient.onRenderProcessGone. When Android's WebView renderer process dies, the default behaviour is to kill the process hosting the WebView — so a renderer crash inside the editor takes the whole app down rather than just the editor.

iOS handles the equivalent case: controllerWebContentProcessDidTerminate resets readiness and reloads the web view, so the editor recovers in place.

$ grep -rn "onRenderProcessGone\|RenderProcessGoneDetail" android/Gutenberg/src/main/java/org/wordpress/gutenberg/
(no matches)

This is separate from the editor's JavaScript ErrorBoundary crash, which is handled in #638, #640 and #642. Those cover a React error that unmounts the editor while the renderer stays alive. This issue is the renderer process itself dying — out-of-memory being the most common cause on lower-end devices.

Step-by-step reproduction instructions

  1. Open the editor in the demo app or WordPress-Android.
  2. Terminate the renderer process for the editor's WebView. Either:
    • adb shell am kill <renderer process> — the sandboxed renderer appears as a child process of the app, or
    • navigate the WebView to chrome://crash from chrome://inspect.
  3. Observe the app process dies rather than the editor recovering.

Expected: the editor recovers, or at minimum reports an unusable editor to the host without terminating the app.

Suggested fix

Override onRenderProcessGone on the WebViewClient, return true to signal the crash was handled, and reuse the recovery path added in #642:

override fun onRenderProcessGone(view: WebView?, detail: RenderProcessGoneDetail?): Boolean {
    isEditorLoaded = false
    reloadEditor()
    return true
}

Returning true is what prevents Android from killing the process. Note the WebView whose renderer died cannot be reused for rendering in all cases, so this may require recreating the WebView rather than reloading it — worth verifying against detail.didCrash() to distinguish a genuine crash from the system reclaiming memory.

Content recovery comes for free through LatestContentProvider, the same path reloadEditor() already uses.

Environment info

  • GutenbergKit trunk
  • Android — all versions; onRenderProcessGone is available from API 26 and the module's minSdk is above that.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VuxMbKtUsaUF8nUVgKdxwK

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.