Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

set nomerge on delta reset #1921

Merged
merged 2 commits into from
Dec 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions src/internal/connector/exchange/exchange_data_collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,20 @@ func NewCollection(
service graph.Servicer,
statusUpdater support.StatusUpdater,
ctrlOpts control.Options,
doNotMergeItems bool,
) Collection {
collection := Collection{
user: user,
data: make(chan data.Stream, collectionChannelBufferSize),
jobs: make([]string, 0),
service: service,
statusUpdater: statusUpdater,
fullPath: curr,
prevPath: prev,
collectionType: collectionType,
ctrl: ctrlOpts,
state: stateOf(prev, curr),
collectionType: collectionType,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

decided to alphabetize these.

ctrl: ctrlOpts,
data: make(chan data.Stream, collectionChannelBufferSize),
doNotMergeItems: doNotMergeItems,
fullPath: curr,
jobs: make([]string, 0),
prevPath: prev,
service: service,
state: stateOf(prev, curr),
statusUpdater: statusUpdater,
user: user,
}

return collection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ func (suite *ExchangeDataCollectionSuite) TestNewCollection_state() {
c := NewCollection(
"u",
test.curr, test.prev,
0, nil, nil, control.Options{})
0, nil, nil, control.Options{},
false)
assert.Equal(t, test.expect, c.State())
})
}
Expand Down
10 changes: 2 additions & 8 deletions src/internal/connector/exchange/service_iterators.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,6 @@ func filterContainersAndFillCollections(
deltaURLs[cID] = newDelta.url
}

if newDelta.reset {
// the previous delta was invalid or otherwise unusable.
// We need to mark the collection as New, and tombstone
// the path to clear out any data for a clean refresh.
prevPath = nil
tombstones[currPath.String()] = struct{}{}
}

edc := NewCollection(
qp.ResourceOwner,
currPath,
Expand All @@ -133,6 +125,7 @@ func filterContainersAndFillCollections(
service,
statusUpdater,
ctrlOpts,
newDelta.reset,
)

collections[cID] = &edc
Expand Down Expand Up @@ -171,6 +164,7 @@ func filterContainersAndFillCollections(
service,
statusUpdater,
ctrlOpts,
false,
)
collections[p] = &edc
}
Expand Down