fix(core): share vertical scene canonicalization - #626
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why
A legacy organization scene could retain an explicit height on an auto-generated ceiling in server authority while the editor removed that field during load. Every recovery snapshot then recreated the representation split and caused subsequent create, delete, undo, and redo operations to conflict.
Verification
Note
Medium Risk
Load-path migration logic affects every scene open and collaboration persistence; the refactor is intended to be behavior-preserving but any divergence in ceiling/wall canonicalization would cause ongoing sync conflicts.
Overview
Moves the vertical-model load migration (level heights, ordinals, wall/ceiling plane binding, stair rise, slab thickness) out of
migrateNodesin the scene store into a puremigrateVerticalSceneNodesutility, re-exported fromscene-migrationsfor server-safe use.The editor still runs it at the end of
migrateNodes; hosted scene authorities can run the same path so client and server canonicalize identical node fields before collaboration compares or persists ops—addressing splits like an auto-ceiling keeping an explicitheighton the server while the editor dropped it on load.The utility adds a
changedflag and returns the original nodes reference when nothing mutates; wall classification skips writes when the effective height already matches.vertical-model.mdnow points at the shared module and documents the client/server invariant.Reviewed by Cursor Bugbot for commit 87d7785. Bugbot is set up for automated code reviews on this repo. Configure here.