force omission of meta files (#2662)

While the `isMeta` flag will solve this in the
future, the current state requires us to filter
out all meta and dirmeta files, even historically.

---

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

- [x]  Yes, it's included

#### Type of change

- [x] 🐛 Bugfix

#### Issue(s)

* #1970

#### Test Plan

- [x]  Unit test
- [x] 💚 E2E
This commit is contained in:
Keepers 2023-02-27 15:46:55 -07:00 committed by GitHub
parent 8860503bb8
commit 1945db6b65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 7 deletions

View File

@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Known Issues
- Folders and Calendars containing zero items or subfolders are not included in the backup.
- OneDrive files ending in `.meta` or `.dirmeta` are omitted from details and restores.
## [v0.4.0] (beta) - 2023-2-20

View File

@ -3,6 +3,7 @@ package details
import (
"context"
"strconv"
"strings"
"sync"
"time"
@ -127,7 +128,13 @@ func (dm DetailsModel) FilterMetaFiles() DetailsModel {
// additional data like permissions in case of OneDrive and are not to
// be treated as regular files.
func (de DetailsEntry) isMetaFile() bool {
return de.ItemInfo.OneDrive != nil && de.ItemInfo.OneDrive.IsMeta
if de.ItemInfo.OneDrive == nil {
return false
}
return de.ItemInfo.OneDrive.IsMeta ||
strings.HasSuffix(de.RepoRef, ".meta") ||
strings.HasSuffix(de.RepoRef, ".dirmeta")
}
// ---------------------------------------------------------------------------

View File

@ -249,8 +249,8 @@ var pathItemsTable = []struct {
},
},
},
expectRepoRefs: []string{"abcde", "foo.meta"},
expectLocationRefs: []string{"locationref", "locationref.dirmeta"},
expectRepoRefs: []string{"abcde"},
expectLocationRefs: []string{"locationref"},
},
{
name: "multiple entries with folder and meta file",
@ -287,8 +287,8 @@ var pathItemsTable = []struct {
},
},
},
expectRepoRefs: []string{"abcde", "12345", "foo.meta"},
expectLocationRefs: []string{"locationref", "locationref2", "locationref.dirmeta"},
expectRepoRefs: []string{"abcde", "12345"},
expectLocationRefs: []string{"locationref", "locationref2"},
},
}
@ -357,7 +357,7 @@ func (suite *DetailsUnitSuite) TestDetailsModel_FilterMetaFiles() {
d2 := d.FilterMetaFiles()
assert.Len(t, d2.Entries, 2)
assert.Len(t, d2.Entries, 1)
assert.Len(t, d.Entries, 3)
}

View File

@ -19,4 +19,5 @@ Below is a list of known Corso issues and limitations:
* Provides no guarantees about whether data moved, added, or deleted in M365
while a backup is being created will be included in the running backup.
Future backups run when the data isn't modified will include the data.
* OneDrive files ending in `.meta` or `.dirmeta` get omitted from Details and Restore commands.