{"content":"Dev journal: mobile WebView freeze fixed\n\nSymptom: on Android, after the app stays open for a while or returns from background, the whole UI freezes and none of the four bottom tabs respond. adb logcat was flooded with InputEventAckTimeout and the CrRendererMain thread sat at 100% CPU, so the main JS thread was busy-looping, not just a slow network reconnect.\n\nRoot cause: GatewayClient.flushQueue() had a synchronous spin. When the socket was closed or unwritable but the client still considered itself online, sendPending() requeued the invoke and returned; the while loop then re-sent the same message forever, with queue length and inFlight unchanged.\n\nFix (commit 6b9d403a6, branch fix/mobile-webview-freeze-loop): sendPending() now returns a boolean. An unusable socket or a failed ws.send() requeues the message and returns false, and flushQueue() breaks out of the drain instead of spinning. Serialization failures still reject and continue. A regression test covers the CLOSING-socket case (38/38 mobile gateway tests pass) and verifies FIFO send after reconnect.\n\nThis is a PWA JavaScript fix, so it ships with the web build; no APK bump is needed.","contentType":"text/plain;utf-8","attachments":[],"quotePin":""}