Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

drive: fix ChangeNotify polling for shared drives

Nick Craig-Wood3ef0c7382688
diff --git a/backend/drive/drive.go b/backend/drive/drive.go
index 00f17e2fc..ebc88aa9d 100644
--- a/backend/drive/drive.go
+++ b/backend/drive/drive.go
@@ -2314,9 +2314,11 @@ func (f *Fs) ChangeNotify(ctx context.Context, notifyFunc func(string, fs.EntryT
func (f *Fs) changeNotifyStartPageToken() (pageToken string, err error) {
var startPageToken *drive.StartPageToken
err = f.pacer.Call(func() (bool, error) {
- startPageToken, err = f.svc.Changes.GetStartPageToken().
- SupportsAllDrives(true).
- Do()
+ changes := f.svc.Changes.GetStartPageToken().SupportsAllDrives(true)
+ if f.isTeamDrive {
+ changes.DriveId(f.opt.TeamDriveID)
+ }
+ startPageToken, err = changes.Do()
return shouldRetry(err)
})
if err != nil {
@@ -2339,7 +2341,7 @@ func (f *Fs) changeNotifyRunner(ctx context.Context, notifyFunc func(string, fs.
changesCall.SupportsAllDrives(true)
changesCall.IncludeItemsFromAllDrives(true)
if f.isTeamDrive {
- changesCall.TeamDriveId(f.opt.TeamDriveID)
+ changesCall.DriveId(f.opt.TeamDriveID)
}
changeList, err = changesCall.Context(ctx).Do()
return shouldRetry(err)