Delete details snapshot on backup delete (#2166)

## Description

Don't leave orphaned details snapshots when a backup is being deleted.

## Does this PR need a docs update or release note?

- [ ]  Yes, it's included
- [ ] 🕐 Yes, but in a later PR
- [x]  No 

## Type of change

- [ ] 🌻 Feature
- [x] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [ ] 💻 CI/Deployment
- [ ] 🧹 Tech Debt/Cleanup

## Issue(s)

* closes #2152

## Test Plan

- [x] 💪 Manual
- [ ]  Unit test
- [ ] 💚 E2E
This commit is contained in:
ashmrtn 2023-01-18 14:28:32 -08:00 committed by GitHub
parent 6f67d9744a
commit 81625532bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -325,6 +325,10 @@ func (r repository) DeleteBackup(ctx context.Context, id model.StableID) error {
return err
}
if err := r.dataLayer.DeleteSnapshot(ctx, bu.DetailsID); err != nil {
return err
}
sw := store.NewKopiaStore(r.modelStore)
return sw.DeleteBackup(ctx, id)