Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Android: a WebView renderer crash kills the host app process

未关闭
#643 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

这个 Issue 还没有评估数据。

描述

[Type] Bug Android Gutenberg

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

主要语言
JavaScript
星标
29
派生
7
平均合并
2 天 3 小时
30 天内合并 PR
71

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

wordpress-mobile/GutenbergKit 的其他 Issue

查看 wordpress-mobile/GutenbergKit 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。