Repository navigation
fix: identify file clips by bundle so other bridges cannot loop them - #18
Open
andrew-boyd wants to merge 1 commit into
Open
andrew-boyd wants to merge 1 commit into
andrew-boyd wants to merge 1 commit into
Conversation
A file snapshot's fingerprint included its text/uri-list, which names the local directory where a bridge staged the files. When a second clipboard bridge (such as Standard Code's clipboard sync) also connects two machines, each bridge restages the other's write under a new path. Neither bridge recognized the result as an echo, so one screenshot looped at 2 to 3 writes per second and filled both staging directories. File snapshots now take their fingerprint from the path-free file bundle alone. The capture loop's existing previous-value check then drops a restaged copy of the files it just sent. Fixes #17
4 tasks
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
ssh-clipboard-site | e00c04a | Oct 08 2026, 09:30 PM |
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.
Fixes #17.
Problem
When ssh-clipboard and a second clipboard bridge (here, Standard Code's clipboard sync) both connect the same two Macs, one copied screenshot loops between them at 2 to 3 clipboard writes per second. Each bridge stages a received file under a new directory. The file snapshot fingerprint included
text/uri-list, which names that directory, so neither bridge recognized the other's rewrite as an echo. One Mac accumulated 17,509 staged copies (1.7 GB) of a single screenshot.Change
fingerprintinsrc/clipboard.rshashes only theapplication/x-ssh-clipboard-file-bundlerepresentation when a snapshot has one. The bundle holds relative names, modes, and contents, and it is identical at every hop.previouscheck then drops a restaged copy of the files the daemon just sent. Other clipboard values keep the full fingerprint.Tests
clipboard::tests::file_fingerprint_ignores_where_the_files_were_stageddaemon::tests::does_not_resend_files_another_bridge_restagedfails without the fingerprint change and passes with it.cargo test --all-targets,cargo fmt --check,cargo clippy --all-targets -D warnings, andnpm testpass.Verification status
An instrumented v0.2.18 build reproduced the loop on the Mac Studio: every capture had the same 3,932-byte bundle with a new Standard Code staging path, and each one was sent. A live run of this branch did not finish because the peer Mac went offline during the test. That check remains to do before release.
Follow-up
Standard Code's
crates/standard-clipboardports this code and has the same path-sensitive fingerprint. It needs the same change in its repository.