iTwin / imodel-transformer

API for exporting an iModel's parts and also importing them into another iModel
MIT License
3 stars 2 forks source link

Fixed an infinite recursion bug when processing changes #57

Closed ViliusRuskys closed 1 year ago

ViliusRuskys commented 1 year ago

The old implementation of forEachTrackedElement querried both target and source iModels at the same time. It also ordered both querries by FederationGuid. This does not fork for the hybrid (ExternalSourceAspect & FederationGuid) approach because some elements were "acquiring" their federation guids during the initial transformation and the provenance for them was lost because both query results were out of order between each other (an element without fed guid in source query was placed in a different place because it was ordered by its "acquired" federationGuid in the target query). This caused the transformer to enter an infinite recursion loop when processing element references. (process inserted element -> process its parent (which already was inserted during initial transformation, but provenance was lost) -> process parent's child elements -> process parent etc.)