← Back to Pull requests

fix(android): take the IPC request URL from the sending frame's origin #1891

Closed
unknown closed this pull request without merging on Oct 23, 2026 11:34 UTC
View on GitHub
unknown unknown commented on Oct 18, 2026 09:29 UTC
Author

On Android, Ipc.postMessage sends RustWebViewClient.currentUrl as the request URL, and that field is only written in onPageStarted on the main looper. When the main thread is busy during a load, the page's first scripts run before that callback, so their IPC calls arrive as about:blank and Tauri's ACL refuses them with event.listen not allowed on window "main", webview "main", URL: about:blank. #1275 narrowed this window without closing it. A stalled main thread on an API 35 emulator reproduces it on every launch, and it also shows up in CI on GitHub-hosted emulators, which is where I encountered this problem, stochastically, and it took me quite some time to narrow it down.

Setting the URL earlier in loadUrl would let the outgoing page send IPC under the incoming page's origin until the navigation commits. This change uses WebViewCompat.addWebMessageListener instead, which reports each message's sender origin. The tracked URL is kept when it matches that origin, the origin is used otherwise, and opaque origins keep sending about:blank as in #1883. The listener runs on the UI thread, and handlers may block on the main pipe, so messages are forwarded on a single background thread. WebViews without WEB_MESSAGE_LISTENER keep the addJavascriptInterface path, with currentUrl now @Volatile. Cross-origin iframes now report their own origin. I tentatively believe this solves the problem as I could not reproduce it any longer, although the stochasticity of it could either mean I am being very lucky right now or that it has become rarer still.

Diff: 198 lines (+148 / -50) across 2 files Reviewer: LucaCappelletti94 Review duration: 7324m
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 198 lines diff across 2 files
0.36
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.317
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1891"
general weight: 0.35
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 36.1% (MEDIUM) · Higher = larger blast radius
36.1%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 14.3% · Safe to merge
14.3%
Repository