Skip to content

Comments

Schema Import Failure: RemapManager fails during cleanup#1329

Open
RohitPtnkr1996 wants to merge 14 commits intomainfrom
rohitptnkr/remapManager-cleanup-error
Open

Schema Import Failure: RemapManager fails during cleanup#1329
RohitPtnkr1996 wants to merge 14 commits intomainfrom
rohitptnkr/remapManager-cleanup-error

Conversation

@RohitPtnkr1996
Copy link
Contributor

A user reported their major schema upgrade was failing with the error "Failed to find class SILO for ensuring persisted property maps."

On further investigation, this was due to a very specific schema evolution scenario:

  1. Base schema contains a class hierarchy.
  2. Minor upgrade where the leaf class overrides the property and adds a child class which inherits the overridden property.
  3. Major upgrade where the overridden property is removed from the parent and the child class is also deleted.

When deleting the property override, the remap manager collects the remap info for the child class using its property map.
Later, the child class gets deleted.
On cleanup and remapping, when the remap manager tries to restore the saved property map info, it fails to find the child class and throws the error.

Fixes https://github.com/iTwin/itwinjs-backlog/issues/1857

@RohitPtnkr1996 RohitPtnkr1996 marked this pull request as draft February 11, 2026 12:31
@RohitPtnkr1996 RohitPtnkr1996 marked this pull request as ready for review February 11, 2026 14:17
@rschili rschili requested a review from Copilot February 11, 2026 14:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a schema remapping cleanup failure when a class is deleted after remap info for its property maps has been collected (specific schema evolution scenario involving property overrides + derived class deletion).

Changes:

  • Add regression test covering “delete property override + delete derived class” for both regular and V8 legacy schema import paths.
  • Prevent remap cleanup from attempting to restore property maps for classes that get deleted during the same import.
  • Add a VS Code debug launch configuration for iModelConsole.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.

File Description
iModelCore/iModelPlatform/Tests/DgnProject/NonPublished/SchemaRemap_Test.cpp Adds a regression test to reproduce and validate the remap cleanup fix.
iModelCore/ECDb/ECDb/SchemaWriter.cpp Calls into RemapManager during class deletion to avoid restoring mappings for deleted classes.
iModelCore/ECDb/ECDb/RemapManager.h Adds a helper to drop cleaned mapping info for a class being deleted.
.vscode/launch.json Adds a new debug configuration for iModelConsole.

@RohitPtnkr1996 RohitPtnkr1996 enabled auto-merge (squash) February 20, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants