Packages aren't comparing attribute changes correctly, due to inconsistent serialization order

Issue Type: Display
Impact: Moderate
Frequency: Often

Reproduction Steps:
Here is a file with the resulting scrambled attribute serialization. Each object is the same, but the AttributesSerialize property is entropic.
DifferingAttributes.rbxlx (43 KB)

To reconstruct this repro with a functioning package under your account, the following script can be pasted into the command bar:

local Selection = game:GetService("Selection")

local test = Instance.new("Configuration")
test.Name = "Publish me as a package!"
test.Parent = workspace

for i = 1, 3 do 
	test:SetAttribute("Test" .. i, i)
end

Selection:Set{test}
test:WaitForChild("PackageLink")

for i = 1, 25 do
	test = test:Clone()
	test.Parent = workspace
end

It will create an object with a few attributes and ask you to convert it into a package.
Once there’s a PackageLink inside of the object, it will be duplicated 25 times into the Workspace.

From here you should see some of the packages marked as changed, despite no changes being made to them from the original copy.

Expected Behavior:
My packages shouldn’t be getting marked as updated if I haven’t actually changed anything. I’ve been trying to utilize attributes in our game’s item data and scripts, but they keep getting marked as changed and we aren’t sure if we have changes to publish or not.

Actual Behavior:
In the repro I provided, comparing the duplicated packages reveals ordering differences in their serialization.

<BinaryString name="AttributesSerialize"><![CDATA[AwAAAAUAAABUZXN0MwYAAAAAAAAIQAUAAABUZXN0MgYAAAAAAAAAQAUAAABUZXN0MQYAAAAAAADwPw==]]></BinaryString>
<BinaryString name="AttributesSerialize"><![CDATA[AwAAAAUAAABUZXN0MQYAAAAAAADwPwUAAABUZXN0MgYAAAAAAAAAQAUAAABUZXN0MwYAAAAAAAAIQA==]]></BinaryString>

They’re storing the same contents, but weren’t serialized in the same order.

Workaround:
If it appears and I know I don’t have any changes pushed, sometimes I can use the “Undo Changes to Package” action, and it’ll properly revert to normal. The issue eventually returns on its own upon changes being made to the package or any of its attributes.

22 Likes

I’ve been running into this issue too. It’s causing a lot of problems since I have to republish everything before actually publishing my game. Causing major headaches.

12 Likes

@Maximum_ADHD: Thanks for the report and detailed steps to reproduce!

We have verified this is a bug and have a fix in the works.

We have modified the attributes serialization order to be deterministic and this appears to fix the package change detection issue. The fix will be released after passing internal testing.

8 Likes

Do we know when this fix will be pushed?

A flag for it has appeared in today’s release:
DFFlagSerializeSortAttributeTable

Once enabled it should be good!

5 Likes

The fix is live now and should resolve the issue.

2 Likes

The fix seems to have corrected the issue. Thanks!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.