fix(winbindex): fall back to MinIO on a pre-send SHA-1 mismatch - #73
Merged
Merged
Conversation
The digest-mismatch branch in streamFromSymbolServer destroyed the response and returned failed_after_send even when zero bytes had reached the client (a symbol server 200 with an empty body for a hash that is not the empty-file hash). The response is still pristine in that case, so it now mirrors the stream-error branch and returns not_available, letting the request fall through to MinIO. Found by Copilot on #72 after merge. winbindex.test.ts 38/38. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NmATMvFbdupfLRq7Ldwabv
There was a problem hiding this comment.
🟢 Approval recommended
The change is narrowly scoped, preserves the existing “fail after send” behavior when bytes were written, and includes a targeted regression test for the reported edge case.
Pull request overview
Fixes an edge case in the Winbindex → Microsoft symbol server streaming path where a SHA-1 mismatch could incorrectly “fail after send” and block the MinIO fallback even when the client received zero bytes (e.g., symbol server returns 200 with an empty body).
Changes:
- In
streamFromSymbolServer, treat a post-stream digest mismatch asnot_available(MinIO fallback) when no bytes were written to the response. - Add a regression test covering the empty-200-body + non-empty-expected-hash scenario to ensure the response remains untouched and fallback is allowed.
File summaries
| File | Description |
|---|---|
| src/winbindex.ts | Allows MinIO fallback on SHA-1 mismatch when wrote === false (no bytes sent). |
| tests/winbindex.test.ts | Adds an empty-body symbol-server case asserting not_available and pristine response state. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 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.
What
Follow-up to #72. Copilot's last review pass (which landed as #72 was being merged) found a real edge in
streamFromSymbolServer:On a SHA-1 mismatch it destroyed the response and returned
failed_after_send— blocking the MinIO fallback — even when zero bytes had been written to the client. That happens if the symbol server returns200with an empty body for a hash that isn't the empty-file hash. In that case the response is still pristine, so the request should just fall through to MinIO.Change
One line: the digest-mismatch branch now checks
wroteand returnsnot_availablewhen nothing was sent, mirroring what the stream-error branch already does.Tests
tests/winbindex.test.ts: added a case (empty 200 body + non-empty expected hash →not_available, response untouched). 38/38 in the winbindex suite; full suite 90 passing (the onetests/git-logfailure is the pre-existing unrelatedTS1378).🤖 Generated with Claude Code
https://claude.ai/code/session_01NmATMvFbdupfLRq7Ldwabv