Repository navigation
Rebuild file transfer as a self-contained core with resume - #171
Merged
Merged
Conversation
Replace FileTransferManager, WebRTCService and FileTransferStore with src/fileTransfer/: an engine that knows nothing of GMCP, WebRTC or IndexedDB, which sit behind a signalling, a link and a storage interface. - One connection per transfer, so several run at once; the panel shows a row with its own progress and Cancel for each. - Bounded memory: the content id is hashed piece by piece, received pieces go straight to storage, and the sender keeps at most 64 pieces out until the receiver reports them stored. - Resume after a lost link or a reload sends only the missing pieces and does not prompt again. - The sender reports success only once the receiver has verified and saved the file. - No connection exists before the user accepts; name, size and content are checked against the accepted offer. Offers are capped per peer and expire, re-offers are bounded, names lose control and bidi characters. - The data-channel format, candidate tagging and content id are new, so this build cannot exchange files with older ones. RequestResend is no longer sent. Accessibility of the panel: history lines are spoken through the client's announcer instead of a live region that is silent in a hidden tab; a new offer names its sender and is spoken when no desktop notification shows; focus goes to the panel heading when the row that held it disappears; the recipient combobox always has its listbox, marks the highlighted option and says when nobody matches; rows are named groups and the progress bar says when it is connecting or verifying.
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
Replaces
FileTransferManager,WebRTCServiceandFileTransferStorewith a new core insrc/fileTransfer/. The engine knows nothing of GMCP, WebRTC or IndexedDB; those sit behind a signalling, a link and a storage interface, andcreateFileTransfers.tsassembles them for the browser.What changes for users
How it works
candidatestring so they can be routed.Trust
Client and UI
client.getFileTransfers()replacesgetFileTransferManager();client.onFileTransferOffer()reports each new incoming offer, and is what notifications and the sidebar now use.RequestResendis removed from theClient.FileTransferpackage.useTransfers,useTransferHistory).Accessibility
Compatibility
The data-channel format, candidate tagging and content id are new, so this build and older builds cannot exchange files with each other.
Docs
docs/GMCP/packages/client-file-transfer.mddescribes the content id, the tagged candidate, the resume marker and the data-channel protocol.Verification
npm run typecheck: clean.npx vitest run: 135 files, 2,061 tests pass.npm run build: the transfer code is its own lazily loaded chunk,createFileTransfers-*.js, 28.7 kB.