lib/model: Prevent localflag flipflopping on del. item (ref #6865) (#6919)

This commit is contained in:
Simon Frei
2020-08-21 10:09:48 +02:00
committed by GitHub
parent cc1f6e4d4a
commit b628460930
+5 -5
View File
@@ -637,11 +637,11 @@ func (f *folder) scanSubdirs(subDirs []string) error {
l.Debugln("marking deleted item that doesn't exist anywhere as not receive-only", file) l.Debugln("marking deleted item that doesn't exist anywhere as not receive-only", file)
batchAppend(file.ConvertDeletedToFileInfo(), snap) batchAppend(file.ConvertDeletedToFileInfo(), snap)
changes++ changes++
case file.IsDeleted() && file.LocalFlags != f.localFlags: case file.IsDeleted() && file.IsReceiveOnlyChanged() && f.Type != config.FolderTypeReceiveOnly:
// No need to bump the version for a file that was // No need to bump the version for a file that was and is
// and is deleted and just the local flags changed. // deleted and just the folder type/local flags changed.
file.LocalFlags = f.localFlags file.LocalFlags &^= protocol.FlagLocalReceiveOnly
l.Debugln("changing localflags on deleted item", file) l.Debugln("removing receive-only flag on deleted item", file)
batchAppend(file.ConvertDeletedToFileInfo(), snap) batchAppend(file.ConvertDeletedToFileInfo(), snap)
changes++ changes++
} }