Skip to content

Object not synced if you remove and add the same file in the bucket #13

@ron-damon

Description

@ron-damon

In the following scenario, object FOO doesn't sync properly:

  1. 🟢 FOO object is uploaded to the bucket -> objinsync add them
  2. 🟢 FOO object is deleted from the bucket -> objinsync remove them
  3. 🔴 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.
  4. 🟢 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions