Skip to content

fix(core): share vertical scene canonicalization - #626

Merged
Aymericr merged 1 commit into
mainfrom
fix/realtime-recovery-canonicalization
Aug 10, 2026
Merged

fix(core): share vertical scene canonicalization#626
Aymericr merged 1 commit into
mainfrom
fix/realtime-recovery-canonicalization

Conversation

@Aymericr

@Aymericr Aymericr commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • extract the complete vertical-model load migration into one pure, idempotent core utility
  • run the same canonicalization from the editor loader and expose it to hosted scene authorities
  • document the shared client/server invariant

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

  • bun test packages/core/src: 950 passed
  • bun run check-types: 10 tasks passed
  • bun run build in packages/core: passed
  • Biome check on touched TypeScript files: passed
  • git diff --check: passed

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 migrateNodes in the scene store into a pure migrateVerticalSceneNodes utility, re-exported from scene-migrations for 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 explicit height on the server while the editor dropped it on load.

The utility adds a changed flag and returns the original nodes reference when nothing mutates; wall classification skips writes when the effective height already matches. vertical-model.md now 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.

@Aymericr
Aymericr merged commit 3fb0870 into main Aug 10, 2026
4 checks passed
@Aymericr
Aymericr deleted the fix/realtime-recovery-canonicalization branch August 10, 2026 18:45
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.

1 participant