Skip to content

fix(emulator): handle invalid scrcpy redirect URLs as download failures - #35511

Closed
OrcaWin wants to merge 1 commit into
audit/scrcpy-jar-atomic-publicationfrom
audit/scrcpy-redirect-parse-failure
Closed

OrcaWin wants to merge 1 commit into
audit/scrcpy-jar-atomic-publicationfrom
audit/scrcpy-redirect-parse-failure

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​21 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​21
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​8 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​7

LoC: +29/-1

Stacked on #35503. Merge/reconcile that PR first, then retarget/rebase onto main and revalidate while preserving completed-download publication.

Reject a malformed scrcpy redirect URL through the download promise. URL parsing previously threw inside the asynchronous response callback, escaping the normal download error path and becoming an uncaught exception. Catch parsing failures, drain the response and use the existing EmulatorError rejection.

Validation:6 configured tests,1 expected parent-baseline regression with5 controls and1 matching uncaught Invalid URL error,strict focused TypeScript and all5 actual normal hook tasks pass. Nine real Node26.8.1 child cases per arm,six exact production modules:at1/10 shared callers a malformed Location makes baseline exit1 without a handled result;final handles the failure and exits0. Complete downloads,absolute/relative redirects,downgrade rejection,missing Location,status errors and redirect limit preserve results. All owned children are absent;socket/profile cleanup recorded. HTTPS URLs map to an owned HTTP server;no TLS/live GitHub,Electron or Android/ADB run. No live endpoint returning malformed headers was observed. The main fatal guard rethrow is source-traced.

Required aggregate queued after #35508; no aggregate pass or Claude takeover claimed. Initial error-type assertion and incorrectly retargeted hook wrapper attempts are preserved;the corrected final commit ran all normal hook tasks and the donor remains clean. No dependency,UI,wire,deadline,retry or path-policy change. Actual macOS/Windows/Electron/Android and CPU/RAM/latency remain untested.

Frozen head a95c879c8b33a4877fabd0010782b959047f3fc7, parent 9c72740f20e6dba7643e721f7d34bc581ffdb5d4. Evidence /home/neil/.local/state/orca-electron-audit/scrcpy-redirect-parse-failure/report.md;94-payload seal 6987271a65e43f2fa0cc04717732327db2275300297092f89d11e2cdf8238f08.

@OrcaWin

OrcaWin commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks. Closing: this only triggers if GitHub, or a TLS proxy the machine already trusts, sends an unparseable redirect Location on the pinned HTTPS release URL. No user hits that, so the extra code and test aren't worth maintaining. It's also stacked on #35503 and has no CI.

Closing per maintainer triage (low-risk / zero user trade-off / material-gain bar).

@OrcaWin OrcaWin closed this Oct 29, 2026
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.

1 participant