Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In-GUI restoration should be possible from trashcan versioner #4631

calmh opened this issue Jan 1, 2018 · 2 comments


None yet
2 participants
Copy link

commented Jan 1, 2018

Currently (#4602) it's not because it doesn't follow the filename tagging scheme. I propose that,

  • GetFolderVersions, when seeing a file without a tag, uses the filename as is and the modtime as the time

  • RestoreFolderVersions, when being asked to restore a file with a given tag and not finding it, checks to see if there is a file without the tag (and only that file?). If so, use it and don't care what the tag says. (Avoids trying to match modtimes with varying precision.)

The modtimes in the trashcan versioner are the time of archiving, so already make sense as is. We just need to pick them up and allow restoration of the files. There will never be more than one version of a file, but the date selection can still make sense to restore any files changed yesterday and yesterday only, for example.

@calmh calmh added the enhancement label Jan 1, 2018


This comment has been minimized.

Copy link

commented Aug 20, 2018

Why can't we just tag files in the trashcan versioner and get on with our lives?


This comment has been minimized.

Copy link
Member Author

commented Aug 20, 2018

Because it's the number one awesome feature of the trashcan versioner that it doesn't mangle your filenames. Otherwise it's just the "basic" versioner or whatever it's called, configured to keep at most one version.

AudriusButkevicius added a commit to AudriusButkevicius/syncthing that referenced this issue Feb 6, 2019

lib/versioner: Restore for all versioners, cross-device support
Fixes syncthing#4631
Fixes syncthing#4586
Fixes syncthing#1634
Fixes syncthing#5338
Fixes syncthing#5419

This also:
1. Forces all versioners to use the same tagging, meaning that trash can versioner will start adding timestamps (cleanup is mtime based so it's ok)
2. Removes Rename function which seems not to be used anywhere important anymore, and TryRename is now RenameOrCopy
3. Versioning (and ton of other stuff) should now happen across filesystems when possible.
4. Adds versioning support for untagged and old file.txt~2014... tagged files. (There was no other way, in order to support trashcan versioner)

AudriusButkevicius added a commit that referenced this issue Apr 28, 2019

lib/versioner: Restore for all versioners, cross-device support (#5514)
* lib/versioner: Restore for all versioners, cross-device support

Fixes #4631
Fixes #4586
Fixes #1634
Fixes #5338
Fixes #5419

@calmh calmh added this to the v1.1.3 milestone Apr 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.