Browse Source

lib/model: Don't error on pulling deletion of invalid file (fixes #5791) (#5792)

Simon Frei 6 years ago
parent
commit
abd363e8bb
1 changed files with 11 additions and 1 deletions
  1. 11 1
      lib/model/folder_sendrecv.go

+ 11 - 1
lib/model/folder_sendrecv.go

@@ -326,7 +326,17 @@ func (f *sendReceiveFolder) processNeeded(dbUpdateChan chan<- dbUpdateJob, copyC
 			changed++
 
 		case runtime.GOOS == "windows" && fs.WindowsInvalidFilename(file.Name):
-			f.newPullError(file.Name, fs.ErrInvalidFilename)
+			if file.IsDeleted() {
+				// Just pretend we deleted it, no reason to create an error
+				// about a deleted file that we can't have anyway.
+				// Reason we need it in the first place is, that it was
+				// ignored at some point.
+				dbUpdateChan <- dbUpdateJob{file, dbUpdateDeleteFile}
+				changed++
+			} else {
+				// We can't pull an invalid file.
+				f.newPullError(file.Name, fs.ErrInvalidFilename)
+			}
 
 		case file.IsDeleted():
 			if file.IsDirectory() {