From edd08269f66ca40ced34ef6907de125e389b3758 Mon Sep 17 00:00:00 2001 From: ashmrtn Date: Thu, 12 Jan 2023 16:35:45 -0800 Subject: [PATCH] Reenable OneDrive kopia-assisted incrementals (#2137) ## Description Reenable kopia-assisted incrementals now that #2136 contains the bugfix patch ## Does this PR need a docs update or release note? - [ ] :white_check_mark: Yes, it's included - [ ] :clock1: Yes, but in a later PR - [x] :no_entry: No ## Type of change - [ ] :sunflower: Feature - [x] :bug: Bugfix - [ ] :world_map: Documentation - [ ] :robot: Test - [ ] :computer: CI/Deployment - [ ] :broom: Tech Debt/Cleanup ## Issue(s) * closes #2133 ## Test Plan - [x] :muscle: Manual - [ ] :zap: Unit test - [ ] :green_heart: E2E --- src/internal/connector/onedrive/collection.go | 14 +++++++------- src/internal/connector/onedrive/collection_test.go | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/internal/connector/onedrive/collection.go b/src/internal/connector/onedrive/collection.go index 4571b15e2..22ac8d746 100644 --- a/src/internal/connector/onedrive/collection.go +++ b/src/internal/connector/onedrive/collection.go @@ -35,10 +35,10 @@ const ( ) var ( - _ data.Collection = &Collection{} - _ data.Stream = &Item{} - _ data.StreamInfo = &Item{} - // _ data.StreamModTime = &Item{} + _ data.Collection = &Collection{} + _ data.Stream = &Item{} + _ data.StreamInfo = &Item{} + _ data.StreamModTime = &Item{} ) // Collection represents a set of OneDrive objects retrieved from M365 @@ -158,9 +158,9 @@ func (od *Item) Info() details.ItemInfo { return od.info } -// func (od *Item) ModTime() time.Time { -// return od.info.Modified() -// } +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 66378f09e..a19021ff7 100644 --- a/src/internal/connector/onedrive/collection_test.go +++ b/src/internal/connector/onedrive/collection_test.go @@ -179,9 +179,9 @@ func (suite *CollectionUnitTestSuite) TestCollection() { assert.Equal(t, testItemName, readItem.UUID()) - // require.Implements(t, (*data.StreamModTime)(nil), readItem) - // mt := readItem.(data.StreamModTime) - // assert.Equal(t, now, mt.ModTime()) + 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)