diff --git a/src/internal/connector/exchange/service_iterators.go b/src/internal/connector/exchange/service_iterators.go index 1580de961..3d8b88332 100644 --- a/src/internal/connector/exchange/service_iterators.go +++ b/src/internal/connector/exchange/service_iterators.go @@ -500,7 +500,9 @@ func IterateSelectAllContactsForCollections( return true // Invalid state TODO: How should this be named } - dirPath, err := path.Builder{}.Append(*folder.GetId()).ToDataLayerExchangePathForCategory( + directory := *folder.GetDisplayName() + + dirPath, err := path.Builder{}.Append(directory).ToDataLayerExchangePathForCategory( qp.Credentials.TenantID, qp.User, path.ContactsCategory, @@ -523,7 +525,7 @@ func IterateSelectAllContactsForCollections( statusUpdater, ) edc.jobs = append(edc.jobs, listOfIDs...) - collections[*folder.GetId()] = &edc + collections[directory] = &edc return true } diff --git a/src/internal/connector/exchange/service_query.go b/src/internal/connector/exchange/service_query.go index cad92773c..2f717cab4 100644 --- a/src/internal/connector/exchange/service_query.go +++ b/src/internal/connector/exchange/service_query.go @@ -141,6 +141,7 @@ func CollectMailFolders( support.ConnectorStackErrorTrace(err), ) } + // Iterator required to ensure all potential folders are inspected // when the breadth of the folder space is large pageIterator, err := msgraphgocore.NewPageIterator(