From cc1d1223524c988f8618ce8c85d585f16edbb491 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Mon, 4 Apr 2016 12:53:55 +0200 Subject: [PATCH] lib/model: Correctly detect deleted but previously ignored files as deleted --- lib/model/model.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/model/model.go b/lib/model/model.go index 87eca7b60..6e7446a93 100644 --- a/lib/model/model.go +++ b/lib/model/model.go @@ -1129,7 +1129,6 @@ func sendIndexes(conn protocol.Connection, folder string, fs *db.FileSet, ignore // time to batch them up a little. time.Sleep(250 * time.Millisecond) } - } func sendIndexTo(initial bool, minLocalVer int64, conn protocol.Connection, folder string, fs *db.FileSet, ignores *ignore.Matcher) (int64, error) { @@ -1433,10 +1432,6 @@ func (m *Model) internalScanFolderSubs(folder string, subs []string) error { fs.WithPrefixedHaveTruncated(protocol.LocalDeviceID, sub, func(fi db.FileIntf) bool { f := fi.(db.FileInfoTruncated) if !f.IsDeleted() { - if f.IsInvalid() { - return true - } - if len(batch) == batchSizeFiles { if err := m.CheckFolderHealth(folder); err != nil { iterError = err @@ -1472,6 +1467,12 @@ func (m *Model) internalScanFolderSubs(folder string, subs []string) error { Modified: f.Modified, Version: f.Version.Update(m.shortID), } + + // The deleted file might have been ignored at some + // point, but it currently isn't so we make sure to + // clear the invalid bit. + nf.Flags &^= protocol.FlagInvalid + batch = append(batch, nf) } }