-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only changed elements should be passed to onExportElement()
while processing changes
#229
Comments
onExportElement()
while processing changes
So this bug has existed for a long time then, correct? Is this causing issues? The hasElementChanged function is currently saving us from this bug, right? |
I think it existed since Fed Guid branch was merged: 1100de5#diff-d07eab136b812db5c475ddb91cbc589d5fd6e5943638c6e2028994d6f58fe80b During my investigation I learned that in previous implementation (before change set parsing was implemented), transformer was querying target element, and it's ESA, to check if element has changed. Currently, it seems to work, and only issue seems to be performance, as target element is queried for each source element:
However, it becomes a pain point in our custom changes PR: https://github.com/iTwin/imodel-transformer/pull/172/files#r1920417272 I think this implementation is error prone, as there are 2 sources of truth keeping track of changed elements ( _sourceDbChanges.element and _hasElementChangedCache ). And those 2 lists need to be kept in sync.
@nick4598 Do you have concerns with removing |
No I think you're right that it probably should be removed, was only asking those questions to make sure I fully understood |
When processing changes
IModelExporter.exportElement()
should skip elements that are not added to_sourceDbChanges.elements.insertedIds
or_sourceDbChanges.elements.updatedIds
, but instead it always tries to export such 'unchanged' elements. it is happening due to this:it should be handled the same way as for models instead. In models case method returns if model is not in change set:
IModelTransformer._hasElementChangedCache
can be removed.IModelTransformer.hasElementChanged
could be removed in favor of custom changes API. I see this is protected, so not sure if there are users that have custom implementations for this.The text was updated successfully, but these errors were encountered: