From 0ad6f440ea73c635fc154edd0829a5b750c73820 Mon Sep 17 00:00:00 2001 From: ashmrtn Date: Wed, 7 Dec 2022 15:07:35 -0800 Subject: [PATCH] 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 - [ ] :sunflower: Feature - [x] :bug: Bugfix - [ ] :world_map: Documentation - [ ] :robot: Test - [ ] :computer: CI/Deployment - [x] :hamster: Trivial/Minor ## Issue(s) * closes #1723 ## Test Plan - [x] :muscle: Manual - [ ] :zap: Unit test - [ ] :green_heart: E2E --- src/internal/connector/onedrive/collection.go | 16 +++++++++------- .../connector/onedrive/collection_test.go | 7 ++++--- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/internal/connector/onedrive/collection.go b/src/internal/connector/onedrive/collection.go index 322c403f6..17c15c1db 100644 --- a/src/internal/connector/onedrive/collection.go +++ b/src/internal/connector/onedrive/collection.go @@ -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 diff --git a/src/internal/connector/onedrive/collection_test.go b/src/internal/connector/onedrive/collection_test.go index 2f1b85ff3..89fe5f33c 100644 --- a/src/internal/connector/onedrive/collection_test.go +++ b/src/internal/connector/onedrive/collection_test.go @@ -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)