Skip to content

Release feedback requests after response handling completes - #26274

Merged
nwparker merged 1 commit into
mainfrom
nwparker/perf-feedback-request-retirement
Oct 8, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/perf-feedback-request-retirement

Conversation

@nwparker

@nwparker nwparker commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Feedback submission can finish while its network request stays open. Submissions now release their own request as soon as the response handling finishes.

What Changed

The feedback request helper aborts its existing controller in cleanup, after the optional image response reader and error handling complete. Successful results, retries, attachment delivery and timeout messages keep their existing behavior. All five production callers use response metadata after the helper returns; the image response body is read inside the awaited callback.

Why

Clearing the deadline after receiving headers leaves an unfinished response without a cleanup owner. Reusing the request's existing controller closes that gap without adding another timer or changing submission policy.

The actual public submission function was exercised with real Electron 43.7.5 HTTP against an owned HTTPS server on macOS. Two failed text submissions make four attempts. With 1 KiB unfinished response bodies, all four original requests remained open 10.5 seconds after submission returned, including after GC and beyond the original deadline. With this change, none remained open. A successful text submission also released its unused response. All 18 paired result, error, request-count and upload-shape controls matched.

This is native resource cleanup after an on-demand submission. It does not establish a cause for the intermittent Codex typing pause or claim a latency improvement.

Linked Issue

Performance audit; no existing issue linked.

Visual Proof

N/A

Submission results and renderer interactions are unchanged. The native before/after request ownership check is described above.

Testing

  • Manually exercised public feedback and crash submissions using real Electron HTTP and an owned native HTTPS server on macOS. No windows were created; all owned processes, sockets and private fixtures were removed.
  • Added seven regressions covering successful and failed submissions, retries, image reader completion, diagnostic fallback, network errors and reader errors. All seven fail against original production code because requests remain active after completion.
  • All 69 feedback, attachment and ownership cases pass in both test runtimes, including Node.
  • Main-process typecheck, all-project build typecheck, fresh desktop build, formatting and two-file changed-code quality pass.
  • Combined audit branch merged with pinned main: 184 focused merge-interaction cases (including feedback), all-project typechecks, fresh desktop build and changed-code quality across 121 files pass.
  • Hosted unit/static checks and macOS packaging pass. Windows packaging remains unresolved after three attempts: first a 20-second timeout in the unchanged port-scan fixture, then two 60-second SysWOW64 process-query timeouts in the unchanged installer fixture. The cause is not established. No source or test limits were changed to bypass these failures.
  • Eighteen temporary native controls preserve outcomes and request shape, including image delivery, malformed responses, diagnostic fallback, body-reader completion and deadlines.

Native resource evidence is macOS/Electron. Windows and Linux use the same controller and cleanup path; no native measurements on those platforms are claimed.

Review

Independent production, native-provenance and regression review found no blocker. The production change is one line. A returned response's unused body is now retired when the helper finishes; the complete production caller census confirms no caller reads that body afterward. No SSH execution authority, remote wire, folder identity, privacy or retry policy changes.

Agent skill upstream boundary

  • Not applicable.

Checklist

  • Small and focused.
  • Explained the user-facing change, mechanism and choice of approach.
  • Visual proof is N/A with the native validation reason above.
  • Self-reviewed for correctness, security and performance.
  • Cross-platform, folder and SSH behavior considered.
  • Relevant tests, typecheck, changed-code quality and fresh build pass; hosted CI will follow.

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c8d624d0-17ff-492f-a6b7-c360127fc304
📥 Commits

Reviewing files that changed from the base of the PR and between 7d6d7ca and 93567c9.

📒 Files selected for processing (2)
  • src/main/ipc/feedback-request-ownership.test.ts
  • src/main/ipc/feedback-request.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

postFeedback now aborts its request controller after clearing the timeout, whether the submission succeeds or fails. New tests cover text and image submissions, diagnostic fallback, retries, network errors, and response-reader errors. The tests also check that image requests remain active until response reading finishes and that attachments are not replayed after an image-request failure.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 93567

The change releases feedback request resources once response handling is done, and existing results and error messages are preserved. No actionable merge-blocking risk was found.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
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. Analyzed 2 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description is detailed and covers the change, rationale, testing, visual proof, review, scope, and compatibility considerations. However, the required Linked Issue section does not contain an act… Add the actual linked issue in the required "Fixes #" section. If the contributor is a maintainer and no issue is required, state that explicitly and attach any applicable pre-existing issue.
✅ Passed checks (3 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly and concisely describes the main change: releasing feedback requests after response handling completes.
Full details: Description check

Explanation

The description is detailed and covers the change, rationale, testing, visual proof, review, scope, and compatibility considerations. However, the required Linked Issue section does not contain an actual issue link and instead states that no issue is linked.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · 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.

@nwparker
nwparker merged commit 9f64453 into main Oct 8, 2026
93 of 99 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