Skip to content

fix(sync): support Ref-typed properties#282

Open
0hirume wants to merge 2 commits into
argon-rbx:mainfrom
0hirume:main
Open

fix(sync): support Ref-typed properties#282
0hirume wants to merge 2 commits into
argon-rbx:mainfrom
0hirume:main

Conversation

@0hirume

@0hirume 0hirume commented Jun 11, 2026

Copy link
Copy Markdown

Adds full two-way sync support for Ref-typed properties (Model.PrimaryPart, Weld.Part0/Part1, ObjectValue.Value, etc.).

  • .rbxm/.rbxmx build/read now preserves internal Ref properties instead of dropping them.
  • For filesystem-based two-way sync, Ref properties are represented as relative-path strings in .data.json/.model.json, resolved back to real Variant::Ref targets via Tree::resolve_refs().
  • Fixes a crash ("Instance meta not found") when inserting .rbxm/.rbxmx files containing internal Ref properties: snapshot_from_dom was reusing Snapshot.id as a remap placeholder, which collided with its other meaning ("corresponds to an existing tree instance") and caused new instances to be misrouted as updates. Introduces a separate transient Snapshot.ref_id field and a two-pass insert + remap, applied to both the live insertion path and the initial tree build path.
  • cargo test --lib (8/8 pass)
  • cargo clippy --all-targets clean
  • Manual end-to-end test via argon serve + companion Studio plugin: created a Model with PrimaryPart and a Weld with Part0/Part1, confirmed .rbxm/.data.json round-trip and live two-way sync work without crashing.

Closes #269

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Object references like Model.PrimaryPart or Weld.Part0 don't get built or synced

1 participant