"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
drive: improve ChangeNotify support for items with multiple parents
Fabian Möllerf8c2689e77a8
diff --git a/backend/drive/drive.go b/backend/drive/drive.goindex c3c1a35d7..8259b4ecc 100644--- a/backend/drive/drive.go+++ b/backend/drive/drive.go@@ -2199,11 +2199,13 @@ func (f *Fs) changeNotifyRunner(notifyFunc func(string, fs.EntryType), startPage// translate the parent dir of this objectif len(change.File.Parents) > 0 {- if parentPath, ok := f.dirCache.GetInv(change.File.Parents[0]); ok {- // and append the drive file name to compute the full file name- newPath := path.Join(parentPath, change.File.Name)- // this will now clear the actual file too- pathsToClear = append(pathsToClear, entryType{path: newPath, entryType: changeType})+ for _, parent := range change.File.Parents {+ if parentPath, ok := f.dirCache.GetInv(parent); ok {+ // and append the drive file name to compute the full file name+ newPath := path.Join(parentPath, change.File.Name)+ // this will now clear the actual file too+ pathsToClear = append(pathsToClear, entryType{path: newPath, entryType: changeType})+ }}} else { // a true root object that is changedpathsToClear = append(pathsToClear, entryType{path: change.File.Name, entryType: changeType})