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

@ -34,7 +34,8 @@ var (
_ data.Collection = &Collection{} _ data.Collection = &Collection{}
_ data.Stream = &Item{} _ data.Stream = &Item{}
_ data.StreamInfo = &Item{} _ data.StreamInfo = &Item{}
_ data.StreamModTime = &Item{} // TODO(ashmrtn): Uncomment when #1702 is resolved.
//_ data.StreamModTime = &Item{}
) )
// Collection represents a set of OneDrive objects retreived from M365 // 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} return details.ItemInfo{OneDrive: od.info}
} }
func (od *Item) ModTime() time.Time { // TODO(ashmrtn): Uncomment when #1702 is resolved.
return od.info.Modified //func (od *Item) ModTime() time.Time {
} // return od.info.Modified
//}
// populateItems iterates through items added to the collection // populateItems iterates through items added to the collection
// and uses the collection `itemReader` to read the item // 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()) assert.Equal(t, testItemName, readItem.UUID())
require.Implements(t, (*data.StreamModTime)(nil), readItem) // TODO(ashmrtn): Uncomment when #1702 is resolved.
mt := readItem.(data.StreamModTime) // require.Implements(t, (*data.StreamModTime)(nil), readItem)
assert.Equal(t, now, mt.ModTime()) // mt := readItem.(data.StreamModTime)
// assert.Equal(t, now, mt.ModTime())
readData, err := io.ReadAll(readItem.ToReader()) readData, err := io.ReadAll(readItem.ToReader())
require.NoError(t, err) require.NoError(t, err)