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

Add DO_NOT_DELETE file below marker directory (fixes #131) #133

Closed
wants to merge 2 commits into from

Conversation

Catfriend1
Copy link
Owner

@Catfriend1 Catfriend1 commented Nov 29, 2018

Purpose
Add "DO_NOT_DELETE" file below marker directory to prevent the syncthing marker folder getting cleaned out for the reason it's an empty folder on Xiaomi MIUI.

Related issues
#131 "[FR] Create dummy, non-empty file in .stfolder to prevent automatic cleanup of empty directories"
syncthing/syncthing-android#1249

Testing
Still needs to be done ...

@Catfriend1 Catfriend1 added the bug label Nov 29, 2018
@Catfriend1 Catfriend1 added this to the 0.14.53 milestone Nov 29, 2018
@Catfriend1 Catfriend1 self-assigned this Nov 29, 2018
@Catfriend1
Copy link
Owner Author

I somehow feel this might be the wrong place to precreate the file below the marker dir when we're in sendreceive mode. Imagine we create the marker and DO_NOT_DELETE file in a read-only location and syncthing believes the empty folder should scan and propagate its emptyness to the other devices thus deleting all files? Hmm... I need to think through it again and then make the proper fix.

@Catfriend1
Copy link
Owner Author

This needs to hold until I've finished #135 "Refactor ConfigXml" as just creating a full path-to-folder will be a risk if syncthing core thinks a newly created folder is empty and deletes files from other (write-able) nodes. So I'll do another implementation as I've begun here: I'll check the configXml, get the folder paths before syncthing starts and if the correct path plus ".stfolder" exists, I'll create the file within ".stfolder".

@Catfriend1 Catfriend1 closed this Dec 18, 2018
@Catfriend1 Catfriend1 deleted the 20181129-fixIssue131 branch December 30, 2018 15:15
@Catfriend1
Copy link
Owner Author

@amirulmenjeni Well, not meaning to advertise this, but if you like to try if the fix works on your phone OS (with the system apps / cleaners your manufacturer put on it) feel free to try out Syncthing-Fork.

@amirulmenjeni
Copy link

@Catfriend1 thanks, will try it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants