Rojo drops Ref properties #142
Labels
impact: medium
Moderate issue for Rojo users or a large issue with a reasonable workaround.
scope: cli
Relevant to the Rojo CLI
size: medium
type: bug
Something happens that shouldn't happen
The instance snapshot system that Rojo uses to avoid bugs with incremental updates doesn't support the concept of instance IDs. When the snapshots are reified as real instances (and eventually written to disk) they're given IDs, but any Ref properties are left untouched.
This is easy to demonstrate. Make a file that has a ref property, like an
ObjectValue
whoseValue
property is set to itself or aModel
with aPrimaryPart
set: https://github.com/LPGhatguy/rbx-dom/blob/3ab3f2dfd0f6753e2c5d7e25482e56cac468a68b/rbx_xml/test-files/part-referent.rbxmxIf you create a minimal project that reads in this model, then build that project with Rojo master to a new rbxmx model file, you'll notice that the Ref value ends up pointing to a referent that isn't present in the file!
This problem seems fairly simple to fix: keep a map from the old IDs to new IDs and rewrite Ref properties as we find them. This should work well as long as we make sure that every time we deserialize a model file that it has unique IDs, or else we'll run into collisions if paths alias.
The text was updated successfully, but these errors were encountered: