Closed JulijaRamoskiene closed 4 months ago
Describe the bug
If root elements are marked as having dangling references, they will be updated in makePartialEntityCompleter() even when skipPropagateChangesToRootElements is set to true:
https://github.com/JulijaRamoskiene/imodel-transformer/blob/8ea8f69b994321215a2eea9df89ee11045948961/packages/transformer/src/IModelTransformer.ts#L734
To Reproduce
skipPropagateChangesToRootElements
true
Verify root element parent ids. They should still be set to 0x1.
0x1
it("should not update root elements when skipPropagateChangesToRootElements is set to true", async () => { const iModelShared: SnapshotDb = IModelTransformerTestUtils.createSharedIModel(outputDir, ["A", "B"]); const iModelA: SnapshotDb = IModelTransformerTestUtils.createTeamIModel( outputDir, "A", Point3d.create(0, 0, 0), ColorDef.green ); IModelTransformerTestUtils.assertTeamIModelContents(iModelA, "A"); const iModelExporterA = new IModelExporter(iModelA); const subjectId: Id64String = IModelTransformerTestUtils.querySubjectId( iModelShared, "A" ); const transformerA2S = new IModelTransformer( iModelExporterA, iModelShared, { targetScopeElementId: subjectId, danglingReferencesBehavior: "ignore", skipPropagateChangesToRootElements: true } ); transformerA2S.context.remapElement(IModel.rootSubjectId, subjectId); // Act await transformerA2S.processAll(); // Assert const rootElements = ["0x10", "0xe"]; rootElements.forEach(rootElementId => { const dictionary = iModelShared.elements.getElement(rootElementId); assert.equal(dictionary.parent?.id, "0x1", `Root element '${rootElementId}' parent should not be remapped to '${dictionary.parent?.id}'.`); }); transformerA2S.dispose(); iModelA.close(); iModelShared.close(); });
Expected behavior Root elements should not be updated.
Desktop (please complete the applicable information):
1.0.0-dev.6
4.5.2
Additional context
Elements in target imodel after running transformation with 0.4.18-fedguidopt.6 @itwin/imodel-transformer package version
0.4.18-fedguidopt.6
Elements in target imodel after running transformation with 1.0.0-dev.6 @itwin/imodel-transformer package version
Related issue: https://github.com/iTwin/imodel-transformer/issues/167
Thanks for the test: https://github.com/iTwin/imodel-transformer/pull/176
Describe the bug
If root elements are marked as having dangling references, they will be updated in makePartialEntityCompleter() even when skipPropagateChangesToRootElements is set to true:
https://github.com/JulijaRamoskiene/imodel-transformer/blob/8ea8f69b994321215a2eea9df89ee11045948961/packages/transformer/src/IModelTransformer.ts#L734
To Reproduce
skipPropagateChangesToRootElements
totrue
.Verify root element parent ids. They should still be set to
0x1
.Expected behavior Root elements should not be updated.
Desktop (please complete the applicable information):
1.0.0-dev.6
4.5.2
Additional context
Elements in target imodel after running transformation with
0.4.18-fedguidopt.6
@itwin/imodel-transformer package versionElements in target imodel after running transformation with
1.0.0-dev.6
@itwin/imodel-transformer package version