Fix file transfer reliability - #96
Merged
Merged
Conversation
github-actions Bot
pushed a commit
that referenced
this pull request
Jul 30, 2026
Fix file transfer reliability 0de252f
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.
Summary
Root cause and impact
File-transfer state crossed asynchronous boundaries without atomic updates or correctly ordered authorization. Concurrent chunk saves could lose metadata, duplicate chunks could corrupt completion accounting, accepted transfers could reject early valid bytes, and buffered sends could wait forever after transport failure. Together these fixes make incoming and outgoing transfers terminate consistently instead of stalling or discarding accepted data.
TDD evidence
The new regressions failed first on all four behaviors: only 6 of 16 concurrent chunk indexes survived, consent was absent during the channel wait, a duplicate chunk triggered premature integrity failure, and buffered sends registered no close/error handlers. The same focused suite then passed 87/87 after the fixes.
Validation
npm test -- src/FileTransferStore.test.ts src/FileTransferManager.test.ts src/WebRTCService.test.ts— 87 passednpm test— 1,052 passednpm run typechecknpm run lint:stagedgit diff --checkCloses #56
Closes #62
Closes #63
Closes #74