Disable kopia-assisted incrementals for OneDrive (#1728)

## Description

Do not implement the StreamModTime interface so kopia-assisted incrementals cannot be used for OneDrive.

Feature should be reenabled when the following are resolved:
* #1702 

## Type of change

- [ ] 🌻 Feature
- [x] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [ ] 💻 CI/Deployment
- [x] 🐹 Trivial/Minor

## Issue(s)

* closes #1723 

## Test Plan

- [x] 💪 Manual
- [ ]  Unit test
- [ ] 💚 E2E
This commit is contained in:
ashmrtn 2022-12-07 15:07:35 -08:00 committed by GitHub
parent 09c48c1ec9
commit 0ad6f440ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 10 deletions

View File

@ -31,10 +31,11 @@ const (
)
var (
_ data.Collection = &Collection{}
_ data.Stream = &Item{}
_ data.StreamInfo = &Item{}
_ data.StreamModTime = &Item{}
_ data.Collection = &Collection{}
_ data.Stream = &Item{}
_ data.StreamInfo = &Item{}
// TODO(ashmrtn): Uncomment when #1702 is resolved.
//_ data.StreamModTime = &Item{}
)
// Collection represents a set of OneDrive objects retreived from M365
@ -133,9 +134,10 @@ func (od *Item) Info() details.ItemInfo {
return details.ItemInfo{OneDrive: od.info}
}
func (od *Item) ModTime() time.Time {
return od.info.Modified
}
// TODO(ashmrtn): Uncomment when #1702 is resolved.
//func (od *Item) ModTime() time.Time {
// return od.info.Modified
//}
// populateItems iterates through items added to the collection
// and uses the collection `itemReader` to read the item

View File

@ -107,9 +107,10 @@ func (suite *OneDriveCollectionSuite) TestOneDriveCollection() {
assert.Equal(t, testItemName, readItem.UUID())
require.Implements(t, (*data.StreamModTime)(nil), readItem)
mt := readItem.(data.StreamModTime)
assert.Equal(t, now, mt.ModTime())
// TODO(ashmrtn): Uncomment when #1702 is resolved.
// require.Implements(t, (*data.StreamModTime)(nil), readItem)
// mt := readItem.(data.StreamModTime)
// assert.Equal(t, now, mt.ModTime())
readData, err := io.ReadAll(readItem.ToReader())
require.NoError(t, err)