Skip to content
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

Error updating element when it gets remapped #28

Open
simsta6 opened this issue Apr 21, 2023 · 0 comments
Open

Error updating element when it gets remapped #28

simsta6 opened this issue Apr 21, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@simsta6
Copy link
Contributor

simsta6 commented Apr 21, 2023

Describe the bug
error updating elements, missing id drawio

Source iModel changes, after first transformation, includes deleted DisplayStyle3D element and added DisplayStyle3D element with the same properties as the first one.

onExportElement function remaps target DisplayStyle3D element. So now it points to newly added DisplayStyle3D (Id: 2 in source iModel).

When transformer reaches point where it deletes elements it deletes DisplayStyle3D element in target.

Then transformer calls finalizeTransformation and tries to update DisplayStyle3D element in target, because it has pending references (excludedElements in jsonProperties). It fails to update that element because it is deleted in target element

To Reproduce

  1. Create empty iModel. Add DisplayStyle3d element that has excludedElements in jsonProperties.
  2. Run transformation
  3. Delete DisplayStyle3d element and add new DisplayStyle3d element with the same properties as first one (I think same code should be enough) in source iModel
  4. Run transformation to trigger processChanges
  5. Transformer crashes with 'error updating element: missing id'

Expected behavior

  • It shouldn't crash
  • Maybe transformer should create new element (with different id and federationGuid) instead of remapping that element

Desktop (please complete the applicable information):

OS: Windows
@itwin/imodel-transformer 0.1.2
iTwin.js Version 3.6.1

@MichaelBelousov MichaelBelousov added the bug Something isn't working label Apr 21, 2023
@MichaelBelousov MichaelBelousov self-assigned this Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants