Rewrite synchronizer deletion and add locking changes in runner #55
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the two changes from Sam's email feedback.
ExternalSourceAspect
's are cleaned up because of their embedding relationship (Figure 1). I don't think the repository links and external sources are cleaned up.Unfortunately the two tests in #standalone and #integration that make an update pass with the synchronizer are now both failing because the iModel is shredded by the new deletion algorithm.Fixed. The connector observed that the source file is unchanged, and skipped the second pass over the iModel.Okay, this marks the start of a bit of a rant. Hopefully it reflects an incorrect understanding of the framework.
In my opinion, the
TestConnector
indicates a larger problem with the synchronizer's current API.SynchronizationResults
, which are trees of elements. All of the children of such a tree do not have provenance information, and the synchronizer ignores their change state. If it detects that the parent has changed, it will fall into a recursive update of the children (updateResultsInIModelForChildren
seems to be buggy as well).ExternalSourceAspect
. The author shouldn't be responsible for providing that ID, because we have the element's provenance information.Like Jeff said, the synchronizer is the minimal set of tools needed to map a source file to an iModel. It's super important. I think it needs a new API. We don't have to be as opinionated as PCF (defining loaders, relationship nodes), but I think we should move closer towards it and provide an intermediate representation. We already have such objects: they're defined in iTwin. With a bit of declaration merging in TypeScript, we can present the synchronizer with element properties and provenance and let it do its thing.
Something like this API. The difficulty is in replacing references to iModel IDs with provenance.
Figure 1