Repository navigation
Fix early Issues disconnect handling - #135
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The lifecycle race is correctly guarded and covered by a focused regression test.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes a response-close race in the Issues refresh endpoint without cancelling shared retrieval work.
Changes:
- Detects responses closed before the close listener is attached.
- Adds deterministic regression coverage for early disconnects and shared refresh ownership.
| File | Description |
|---|---|
web/server.ts |
Handles missed response-close events during Issues refresh. |
test/issue-board.test.ts |
Tests the early-disconnect race and retrieval continuity. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Outcome
A POST to the Issues refresh endpoint now notices when its response closed while the request body was still being read. The departed HTTP request stops waiting without cancelling server-owned issue retrieval for another caller.
Resolves issue 58.
Reproduction and fix
Baseline:
91e49c16c1e7de8a4551b4a39d86e995f3b4d6e4A deterministic request-lifecycle gate forces the response
closeevent before the endpoint attaches its listener. Before the fix,IssueBoard.refreshreceived a live signal and the departed waiter remained pending. The endpoint now checksres.closed || res.destroyedimmediately after listener registration, closing the lost-event window.Validation
Validated head:
67d45023b38df18063e5b09a11ea035d403235eanpm test -- --run test/issue-board.test.ts: 10 passed.npm run typecheck: passed.git diff --check origin/main...HEAD: passed.npm test: interrupted after prolonged concurrent Docker-suite contention. It reported one unrelated review-note persistence timeout; the exact test passed alone (1 passed, 17 skipped).Review rounds
67d4502): approval recommended, balanced effort, no findings, no inline threads. Nothing changed or declined.Review-lesson audit