Skip to content

fix(diagnostics): handle late request errors until socket close - #35496

Merged
OrcaWin merged 1 commit into
mainfrom
audit/diagnostic-http-request-retirement
Oct 29, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
audit/diagnostic-http-request-retirement

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 29, 2026 •

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

LoC: +17/-1

Prevent a diagnostic-upload timeout from raising an uncaught main-process error. Rejecting the timeout destroys ClientRequest, which can emit ECONNRESET asynchronously after the old cleanup removed its error listener. Retain the existing guarded handler until request close, then remove it. The actual main-process guard rethrows this error code.

Validation:4 configured tests,1 expected baseline regression/3 controls,strict focused TypeScript and all5 normal hook tasks pass. Exact production code through real Node24 HTTP:22 scenario groups per arm,N1/10,110 requests each; baseline11 uncaught errors→final0. Healthy JSON/empty replies, cap rejection, malformed/error responses, peer resets, finite flowing bodies and request headers/body are preserved. Separate no-handler subprocesses at both short and actual10s token timeouts:baseline exits1,final exits0 with the handled timeout rejection. Final request error handlers disappear after real close; all owned sockets/timers clean up.

Required aggregate queued after #35493; no aggregate pass or Claude takeover claimed. Source-reviewed settings/IPC/upload/main-fatal-guard path and6 source blobs equal mainad500702. Native Orca/Electron and live support service were not launched; no TLS/macOS/Windows/CPU/heap/latency claim. No new deadline, transport, wire contract, UI or dependency operation. Failed fixture assumptions and broader prototype attempts are retained in the evidence report.

Frozen head 4d2fb3c04454543f5ed95e9bf44253429c620004, base 79dbada2c873bef3584a0c53b23ae98f2a84e536. Evidence /home/neil/.local/state/orca-electron-audit/diagnostic-http-request-retirement/report.md;62-payload seal 1cc84f5c8736817c0f22e812e33dedb4bf1cf7a602780b9e674a553df02ec56e.

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable defects were found.

Summary

Keeps the diagnostic request’s error handler attached until the request closes.

  • Diagnostic requests keep catching socket errors until they close.

Reviews (4) · Last reviewed commit: "fix(diagnostics): handle late request er..." · Reviewed by Greptile

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4ac1e512-57e9-4129-9a02-ebacfc89ab86
Commits

Reviewing files that changed from the base of the PR and between 4d2fb3c and 19c7faa.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
Walkthrough

The diagnostic upload request now removes its error listener when the request emits close. Tests emit close after invalid-JSON, successful, and oversized-response assertions. A timeout test checks that the request is destroyed once, a later socket error does not throw, and no event listeners remain after close.

Priority: Normal

Merge Risk: Minimal · previous review 4d2fb

The listener cleanup change has no established merge-blocking risk.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description covers the required template areas: a plain-language summary (What Changed and Why are both present in substance), a mechanism explanation, validation and testing details, and a remote… Restructure the description to follow the repository template. Add ELI5, What Changed (before and after behavior), Why (including alternatives considered), Linked Issue with a real issue number (the template requires one for outside contrib…
Docstring Coverage Warning 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 Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title names the main change: late request errors from the diagnostic-upload timeout are now handled until the socket closes. It uses the conventional fix(diagnostics) prefix and matches the single…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: late request errors from the diagnostic-upload timeout are now handled until the socket closes. It uses the conventional fix(diagnostics) prefix and matches the single production change in diagnostic-upload-http.ts, which moves removal of the request error listener to the close handler.

Full details: Description check

Explanation

The description covers the required template areas: a plain-language summary (What Changed and Why are both present in substance), a mechanism explanation, validation and testing details, and a remote-only note on the native runtime scope. It does not follow the template headings. The ELI5, Why, Visual Proof, Testing checklist, AI Disclosure, and Review sections are absent, and the Linked Issue section reads 'Fixes #' with no issue number. The description is long, dense, and hard to scan. It also cites an external evidence path and a seal hash that a reviewer cannot access. The Agent skill upstream boundary and Checklist sections are missing. The content is substantive but the structure departs from the required template.

Resolution

Restructure the description to follow the repository template. Add ELI5, What Changed (before and after behavior), Why (including alternatives considered), Linked Issue with a real issue number (the template requires one for outside contributors, and 'Fixes #' is empty), Visual Proof (or N/A with reason), Testing (with platforms tested and the checkbox state), AI Disclosure, Review, Agent skill upstream boundary, and Checklist sections. Replace or supplement the local evidence path with information reviewers can access.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@OrcaWin
OrcaWin force-pushed the audit/diagnostic-http-request-retirement branch 2 times, most recently from 7f320ed to 38de0ff Compare October 29, 2026 21:18
@OrcaWin
OrcaWin force-pushed the audit/diagnostic-http-request-retirement branch from 38de0ff to 19c7faa Compare October 29, 2026 21:43
@OrcaWin
OrcaWin merged commit c2cc986 into main Oct 29, 2026
41 checks passed
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