Ref property application can fail when pointed-to instances don't yet exist #928
Labels
impact: medium
Moderate issue for Rojo users or a large issue with a reasonable workaround.
type: bug
Something happens that shouldn't happen
This issue is related to the order of addition operations within the Rojo plugin's reconciler:
rojo/plugin/src/Reconciler/applyPatch.lua
Lines 40 to 79 in 5c4260f
There's a problem at line 73. In this loop, we reify each incoming added instance one after the other, thereby creating each one with
Instance.new
and applying any properties (which includes Refs). It's possible to break this by having two sibling instances, and creating a Ref property on one that points to the other:When I sync this project into Roblox Studio, it fails to apply
ObjectValue.Value
. If I disconnect and reconnect, then the property applies correctly, suggesting that the cause is related to the order of operations (i.e.MyCoolPart
doesn't yet exist at the time at the time of the ObjectValue's reification). For correctness, we should be creating all added instances before attempting to apply Ref properties. We'll probably need to decouple instance creation and property application in this case.Originally posted by @kennethloeffler in #843 (comment)
The text was updated successfully, but these errors were encountered: