Android: a WebView renderer crash kills the host app process
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
这个 Issue 还没有评估数据。
描述
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
- Open the editor in the demo app or WordPress-Android.
- 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://crashfromchrome://inspect.
- 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;
onRenderProcessGoneis available from API 26 and the module'sminSdkis above that.
🤖 Generated with Claude Code
- 主要语言
- JavaScript
- 星标
- 29
- 派生
- 7
- 平均合并
- 2 天 3 小时
- 30 天内合并 PR
- 71
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
wordpress-mobile/GutenbergKit 的其他 Issue
-
[Type] Bug [Type] Code Quality iOS
难度 2/5 1-3 小时 新手友好度 88/100
wordpress-mobile/GutenbergKit#668 ·
维护者通常 1 天内回复
-
[Type] Bug [Type] Performance iOS
难度 2/5 1-3 小时 新手友好度 88/100
wordpress-mobile/GutenbergKit#666 ·
维护者通常 1 天内回复
-
[Type] Bug iOS
难度 2/5 1-3 小时 新手友好度 78/100
wordpress-mobile/GutenbergKit#664 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
wordpress-mobile/GutenbergKit#522 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
wordpress-mobile/GutenbergKit#443 ·
维护者通常 1 天内回复
查看 wordpress-mobile/GutenbergKit 的全部 Issue
相似的 Issue
-
bug require-triage
难度 2/5 1-3 小时 新手友好度 72/100
expressjs/expressjs.com#2549 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
vercel-labs/agent-skills#348 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
NanmiCoder/dsh-agent-teams#289 ·
维护者通常 1 天内回复