Skip to content

fix(sdk): handle WebView render process crash - #287

Open
CAMOBAP wants to merge 2 commits into
mainfrom
fix/webview-render-process-gone
Open

CAMOBAP wants to merge 2 commits into
mainfrom
fix/webview-render-process-gone

Conversation

@CAMOBAP

@CAMOBAP CAMOBAP commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator

Fixes #214

WebViewClient.onRenderProcessGone was not overridden, so a renderer death killed the host app. Mirrors the iOS SDK, which surfaces the generic error from webViewWebContentProcessDidTerminate rather than adding a dedicated one — no new public API.

Reproduced on an API 35 emulator with Page.crash over CDP, while the checkbox was shown:

Before After
Host app Process com.hcaptcha.example (pid 31982) has died survives
chromium [FATAL:crashpad_client_linux.cc:744] Render process (32123)'s crash wasn't handled by all associated webviews, triggering application crash. —
Listener never called hCaptcha failed: WebView render process did terminate(29)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Diffuse report:

OLD: sdk-main.aar
NEW: sdk-pr.aar

 AAR      │ old       │ new       │ diff   
──────────┼───────────┼───────────┼────────
      jar │  98.8 KiB │    99 KiB │ +205 B 
 manifest │     411 B │     411 B │    0 B 
      res │  28.3 KiB │  28.3 KiB │    0 B 
    other │     1 KiB │     1 KiB │    0 B 
──────────┼───────────┼───────────┼────────
    total │ 128.5 KiB │ 128.7 KiB │ +205 B 

 JAR     │ old │ new │ diff       
─────────┼─────┼─────┼────────────
 classes │  62 │  62 │  0 (+0 -0) 
 methods │ 835 │ 838 │ +3 (+5 -2) 
  fields │ 287 │ 287 │  0 (+0 -0)
AAR
 size   │ diff   │ path          
────────┼────────┼───────────────
 99 KiB │ +205 B │ ∆ classes.jar 
────────┼────────┼───────────────
 99 KiB │ +205 B │ (total)
JAR
METHODS:

   old │ new │ diff       
  ─────┼─────┼────────────
   835 │ 838 │ +3 (+5 -2) 
  
  + com.hcaptcha.sdk.HCaptchaWebViewHelper access_200(HCaptchaWebViewHelper) → IHCaptchaVerifier
  + com.hcaptcha.sdk.HCaptchaWebViewHelper access_300(HCaptchaWebViewHelper) → HCaptchaWebView
  + com.hcaptcha.sdk.HCaptchaWebViewHelper_HCaptchaWebClient onRenderProcessGone(WebView, RenderProcessGoneDetail) → boolean
  + android.webkit.RenderProcessGoneDetail didCrash() → boolean
  + java.lang.StringBuilder append(boolean) → StringBuilder
  
  - com.hcaptcha.sdk.HCaptchaWebViewHelper access_200(HCaptchaWebViewHelper) → HCaptchaWebView
  - com.hcaptcha.sdk.HCaptchaWebViewHelper access_300(HCaptchaWebViewHelper) → IHCaptchaVerifier

@CAMOBAP CAMOBAP self-assigned this Oct 18, 2026
@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Benchmark report:

Test name Time ms. (median) Allocations (median)
com.hcaptcha.sdk.HCaptchaBenchmarkTest.EMULATOR_UNLOCKED_benchmarkInvisibleVerification +415.66 +26
com.hcaptcha.sdk.HCaptchaBenchmarkTest.EMULATOR_UNLOCKED_benchmarkInvisibleVerificationColdRun +491.19 +551
com.hcaptcha.sdk.HCaptchaBenchmarkTest.EMULATOR_UNLOCKED_benchmarkInvisibleSetup -1.00 +515
com.hcaptcha.sdk.HCaptchaDebugInfoTest.EMULATOR_UNLOCKED_benchmarkDebugInfo -14.82 -5571
com.hcaptcha.sdk.HCaptchaDebugInfoTest.EMULATOR_UNLOCKED_benchmarkDebugSys +23.95 +2

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Render process crash

1 participant