You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(emulator): wait for complete scrcpy server downloads - #35503
Keep a partially downloaded scrcpy JAR out of the ready cache. Starting another Android screen stream after the first10KB arrived previously handed its device the unfinished JAR. Download to a unique sibling file, validate the completed transfer, then rename it into the cache; remove staging on failures.
Validation:20 configured tests/2 suites,2 expected baseline regressions with3 controls,strict focused TypeScript and all5 normal hook tasks pass. Actual committed production code through real Node HTTP/filesystem and AndroidStreamController:9 groups per arm. At1/10 later device starts, baseline hands off16KB partial files; final starts0 until all64KB arrive. Same-device dedupe, interrupted-transfer rejection and full-byte retry, cached reuse, undersized/status/redirect outcomes and resource cleanup are preserved. HTTPS requests are mapped to an owned loopback HTTP server; the device-start seam reads actual bytes but launches no ADB/device process.
Required aggregate queued after #35496; no aggregate pass or Claude takeover claimed.16 production/caller blobs equal mainb2feed0e924c36d4d1610df6c47ab50c29b60cec. No dependency, UI, wire or path-policy change. Actual runtime: Node26.8.1 (corrects the sealed report’s Node24.22 label; raw sealed JSON records v26.8.1). Actual Android/ADB, native Electron UI, live GitHub/TLS,macOS/Windows,CPU/RAM/latency and process-crash recovery were not tested. Existing minimum-size validation remains; this does not repair older truncated caches already over10KB. Nearby #35490/#9950 are distinct and must survive rebase.
Frozen head 9c72740f20e6dba7643e721f7d34bc581ffdb5d4, base 79dbada2c873bef3584a0c53b23ae98f2a84e536. Evidence /home/neil/.local/state/orca-electron-audit/scrcpy-jar-atomic-publication/report.md;48-payload seal 8e163f1766af6eeeb813334fb8b200bf5f29796180418b73853c07a70f60e14d.
The download writes to a staging path, validates its size, and renames valid data to the final path. It removes the staging file after success or failure and preserves an existing final file when a download fails. New tests cover concurrent callers, partial downloads, cleanup, and retry.
Priority: Normal
Merge Risk: Minimal · up to 5e569
The change makes the scrcpy server JAR appear in the cache only after its download completes, which removes the chance of starting a stream from a partial file. Tests cover concurrent callers and interrupted transfers. I found no established defect that should block merging. The only open question is a narrow multi-process cache-sharing scenario, which is unlikely given the per-profile instance lock.
Pre-merge checks: 3 · 2
Failed checks: 2 warnings
Check name
Status
Explanation
Resolution
Description check
The description explains the problem, implementation, validation scope, and known limitations. However, it does not follow the required template and omits or leaves incomplete required items, includin…
Rewrite the description using all required template headings. Add an actual linked issue, provide a brief ELI5 explanation, state the before-and-after behavior and rationale, mark Visual Proof as N/A with a reason if applicable, record test…
Docstring Coverage
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 3 passed
Check name
Status
Explanation
Title check
The title clearly and concisely describes the main change: preventing consumers from using incomplete scrcpy server downloads.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Description check
Explanation
The description explains the problem, implementation, validation scope, and known limitations. However, it does not follow the required template and omits or leaves incomplete required items, including the ELI5, What Changed, Why, Linked Issue with an actual issue reference, Visual Proof or N/A statement, Testing checkboxes, AI Disclosure, Review, Notes, and Checklist sections.
Resolution
Rewrite the description using all required template headings. Add an actual linked issue, provide a brief ELI5 explanation, state the before-and-after behavior and rationale, mark Visual Proof as N/A with a reason if applicable, record testing and platform coverage, complete applicable checklist items, and include AI Disclosure if required.
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches: 💡 1
📝 Generate docstrings: 💡
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Keeps unfinished scrcpy downloads out of the ready cache.
Android stream starts wait for the complete scrcpy JAR.
No actionable issues found.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Request server JAR] --> B{Cached JAR ready?}
B -->|Yes| C[Return cached path]
B -->|No| D[Share pending download]
D --> E[Download to staging file]
E --> F{Transfer succeeds and size passes?}
F -->|Yes| G[Rename into cache]
G --> C
F -->|No| H[Remove staging file and reject]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LoC: +135/-10
Keep a partially downloaded scrcpy JAR out of the ready cache. Starting another Android screen stream after the first10KB arrived previously handed its device the unfinished JAR. Download to a unique sibling file, validate the completed transfer, then rename it into the cache; remove staging on failures.
Validation:20 configured tests/2 suites,2 expected baseline regressions with3 controls,strict focused TypeScript and all5 normal hook tasks pass. Actual committed production code through real Node HTTP/filesystem and AndroidStreamController:9 groups per arm. At1/10 later device starts, baseline hands off16KB partial files; final starts0 until all64KB arrive. Same-device dedupe, interrupted-transfer rejection and full-byte retry, cached reuse, undersized/status/redirect outcomes and resource cleanup are preserved. HTTPS requests are mapped to an owned loopback HTTP server; the device-start seam reads actual bytes but launches no ADB/device process.
Required aggregate queued after #35496; no aggregate pass or Claude takeover claimed.16 production/caller blobs equal mainb2feed0e924c36d4d1610df6c47ab50c29b60cec. No dependency, UI, wire or path-policy change. Actual runtime: Node26.8.1 (corrects the sealed report’s Node24.22 label; raw sealed JSON records v26.8.1). Actual Android/ADB, native Electron UI, live GitHub/TLS,macOS/Windows,CPU/RAM/latency and process-crash recovery were not tested. Existing minimum-size validation remains; this does not repair older truncated caches already over10KB. Nearby #35490/#9950 are distinct and must survive rebase.
Frozen head
9c72740f20e6dba7643e721f7d34bc581ffdb5d4, base79dbada2c873bef3584a0c53b23ae98f2a84e536. Evidence/home/neil/.local/state/orca-electron-audit/scrcpy-jar-atomic-publication/report.md;48-payload seal8e163f1766af6eeeb813334fb8b200bf5f29796180418b73853c07a70f60e14d.