diff --git a/src/internal/connector/onedrive/collections.go b/src/internal/connector/onedrive/collections.go index de9f63544..9344e708a 100644 --- a/src/internal/connector/onedrive/collections.go +++ b/src/internal/connector/onedrive/collections.go @@ -640,24 +640,19 @@ func (c *Collections) UpdateCollections( } if !found { - // We only create collections for folder that are not - // new. This is so as to not create collections for - // new folders without any files within them. - if prevPath != nil { - col := NewCollection( - c.itemClient, - folderPath, - prevPath, - driveID, - c.service, - c.statusUpdater, - c.source, - c.ctrl, - invalidPrevDelta, - ) - c.CollectionMap[*item.GetId()] = col - c.NumContainers++ - } + col := NewCollection( + c.itemClient, + folderPath, + prevPath, + driveID, + c.service, + c.statusUpdater, + c.source, + c.ctrl, + invalidPrevDelta, + ) + c.CollectionMap[*item.GetId()] = col + c.NumContainers++ } if c.source != OneDriveSource { @@ -743,14 +738,6 @@ func (c *Collections) UpdateCollections( if !removed { return clues.New("removing from prev collection").With("item_id", *item.GetId()) } - - // If that was the only item in that collection and is - // not getting added back, delete the collection - if itemColID != collectionID && - pcollection.IsEmpty() && - pcollection.State() == data.NewState { - delete(c.CollectionMap, itemColID) - } } itemCollection[*item.GetId()] = collectionID