From 82f1679cb83f39335884e5ff5a8900d6f854b508 Mon Sep 17 00:00:00 2001 From: ashmrtn <3891298+ashmrtn@users.noreply.github.com> Date: Fri, 1 Sep 2023 16:42:08 -0700 Subject: [PATCH] Mark all folders we're not keeping as tombstoned (#4177) Increase the number of folders that we tombstone so that we only keep the things that were explicitly requested for the backup. This also helps keep things consistent since we only add folders to the previous paths and previous deltas maps if they were selected during the backup --- #### Does this PR need a docs update or release note? - [ ] :white_check_mark: Yes, it's included - [ ] :clock1: Yes, but in a later PR - [x] :no_entry: No #### Type of change - [ ] :sunflower: Feature - [x] :bug: Bugfix - [ ] :world_map: Documentation - [ ] :robot: Supportability/Tests - [ ] :computer: CI/Deployment - [ ] :broom: Tech Debt/Cleanup #### Issue(s) * #4175 #### Test Plan - [x] :muscle: Manual - [ ] :zap: Unit test - [ ] :green_heart: E2E --- src/internal/m365/collection/exchange/backup.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/internal/m365/collection/exchange/backup.go b/src/internal/m365/collection/exchange/backup.go index f9d7cf9eb..7764ef200 100644 --- a/src/internal/m365/collection/exchange/backup.go +++ b/src/internal/m365/collection/exchange/backup.go @@ -124,7 +124,6 @@ func populateCollections( } cID := ptr.Val(c.GetId()) - delete(tombstones, cID) var ( err error @@ -148,6 +147,8 @@ func populateCollections( continue } + delete(tombstones, cID) + if len(prevPathStr) > 0 { if prevPath, err = pathFromPrevString(prevPathStr); err != nil { logger.CtxErr(ictx, err).Error("parsing prev path")