In the following scenario, object FOO doesn't sync properly:
- 🟢
FOO object is uploaded to the bucket -> objinsync add them
- 🟢
FOO object is deleted from the bucket -> objinsync remove them
- 🔴 The same
FOO object is uploaded again to the bucket -> objinsync doesn't add them
If I restart objinsync after this step, it will sync properly.
- 🟢
FOO object is uploaded with a modified content -> objinsync add them
I think it's because of the uidCache that is not purged when a file is deleted.
Maybe adding a delete in this for works:
for f, _ := range self.filesToDelete {
os.Remove(f)
uidKey, err := uidKeyFromLocalPath(self.LocalDir, f)
if err == nil {
self.uidLock.Lock()
delete(self.uidCache, uidKey)
self.uidLock.Unlock()
}
}
Disclaimer: I'm not a Go expert