Repository navigation
feat(sync): check a conflict against the bytes before asking - #78
Merged
Merged
Conversation
- SMB, FTP and WebDAV tag files by size and time, which a copy made separately never matches, so a remote added with the saves already on it asked once per file. Drive and Dropbox already settle this with a content hash. - With two or more sides changed and the 3DS holding a copy, each changed remote without a content hash is checked: a known size that differs settles it; otherwise the remote copy is downloaded beside the save and compared byte for byte. A match drops out of the prompt and is recorded as in step, with nothing copied. - A copy that differs is kept: if that side wins the prompt it is moved into place instead of being downloaded again. Unused copies are removed however the decision ends. - [Sync] CompareUpTo= (KB, default 4096, 0 = no limit) bounds the download made before the prompt; CompareConflicts=false turns the check off. A bad value is a startup issue and the default applies. - FTP (SIZE), SMB and WebDAV (getcontentlength) now report a file's size. - The local walk skips names ending in .3dstmp, so a download or comparison cut short is never synced as a save. - The configurator's step 2 has a Conflicts block for both settings, shown when an SMB, FTP or WebDAV remote is configured; inifile.js reads and writes [Sync] and keeps its other lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
michvllni
force-pushed
the
feat/compare-before-conflict
branch
from
November 8, 2026 20:33
9803443 to
2c8e55d
Compare
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.
Why
SMB, FTP and WebDAV tag files by size and time, so a copy made separately never matches: a remote added with the saves already on it, or a file copied back by hand, asked once per file. Drive and Dropbox already settle this with their content hash.
What changes
sameAsLocalCopy()insyncengine.cpp):<save>.compare<n>.3dstmpand compared byte for byte (compareFiles()inutils/fsutil).FetchedCopiesremoves unused copies howeversyncFile()returns.RemoteFileInfo::sizeis new, filled in by FTP (SIZE), SMB, and WebDAV (getcontentlength)..3dstmp, so a download or comparison cut short is never synced as a save.inifile.jsreads and writes[Sync], writes it only when it says something, and keeps its other lines.Tests
make -C tests: 279 pass. 15 are new (F=compare):compareFiles();Plus WebDAV's size parsing in
test_remoteparse.node --test tests/configurator/*.test.js: two new cases for writing and reading[Sync].The 3DS build has no warnings.
Not yet tested
testinfra/exists.🤖 Generated with Claude Code