Fix bug fetching contact folders with filters (#986)

## Description

Stop fetching all folders for every new folder seen, erasing previous results. Regression test to come in a later patch as it requires some extra infrastructure

## Type of change

<!--- Please check the type of change your PR introduces: --->
- [ ] 🌻 Feature
- [x] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [ ] 💻 CI/Deployment
- [ ] 🐹 Trivial/Minor

## Issue(s)

* closes #982 

## Test Plan

<!-- How will this be tested prior to merging.-->
- [ ] 💪 Manual
- [x]  Unit test
- [ ] 💚 E2E
This commit is contained in:
ashmrtn 2022-09-29 16:20:50 -07:00 committed by GitHub
parent 11a7490400
commit 4e86cd2f84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -449,6 +449,8 @@ func IterateSelectAllContactsForCollections(
return true return true
} }
isPrimarySet = true
// Create and Populate Default Contacts folder Collection if true // Create and Populate Default Contacts folder Collection if true
if qp.Scope.Matches(selectors.ExchangeContactFolder, DefaultContactFolder) { if qp.Scope.Matches(selectors.ExchangeContactFolder, DefaultContactFolder) {
dirPath, err := path.Builder{}.Append(DefaultContactFolder).ToDataLayerExchangePathForCategory( dirPath, err := path.Builder{}.Append(DefaultContactFolder).ToDataLayerExchangePathForCategory(
@ -486,7 +488,6 @@ func IterateSelectAllContactsForCollections(
edc.jobs = append(edc.jobs, listOfIDs...) edc.jobs = append(edc.jobs, listOfIDs...)
collections[DefaultContactFolder] = &edc collections[DefaultContactFolder] = &edc
isPrimarySet = true
} }
} }