lune-org/lune

Place serialization doesnt remove UniqueIDs and causes conflicts

Closed this issue · 6 comments

Update 0.7.2 introduced removal of UniqueIDs and alike components for specifically models were introduced, however this was not implemented yet for place serialization level causing conflicts that disallow studio to open.

We currently utilize lune in multiple projects and causes some major disturbances due to the error given below.

afbeelding
afbeelding
afbeelding

Error in relation after serialization

RBXCRASH: UniqueID collision detected (SessionID = <SESSION>, UniqueID = <UNIQUE ID>, new Instance = UniverseData.PlaceId (Guid = 0.212512), registered Instance = UniverseData.UniverseId (Guid = 0.212511))

instances referenced in the log were created through lune, however this also happens when transfering objects between 2 different files

Can you create a minimal reproduction (make a zip file that contains place file(s) + Luau script that results in the problem, and attach it here)? See if you can start with e.g. a fresh baseplate and still get the problem to happen

[...] however this was not implemented yet for place serialization level causing conflicts that disallow studio to open.

This is just a hypothesis, and while there's a chance it's correct, it isn't of great help to understand what's really going wrong☹️

Unfortunately i cannot create a minimal reproduction.
It seems that newly published places on Roblox don't have this issue but some older places do, i have tested this by re-publishing the EXACT place that had the issue to a new universe and place which worked from there but it shouldn't be needed to do so.

Keep in mind just publishing the place on itself in the place studio itself doesn't fix the the issue so it's rather inconsistent on what happens.

Creating a data model using lune doesnt have this issue directly (from my experience) as its pretty much a clean slate. I'm more than willing to screen share the issue and go from there though i cannot provide project files directly.

So good news on that. After digging around in older published places I managed to make a reproduction utilizing a place i forked from a public test project a while back, which seems to reproduce the issue 100% of the time.

This place file is public for editing too (as far as i know)

The provided rbxl file before running represents a clean, non adjusted state of the project.
After opening the file simply open a git bash terminal and run npm run build or simply just run the build.sh script whichever is preffered

there will be different outputs, temp/scripts/Game.rbxl which is the output of rojo compile into an rbxl and temp/ERROR.rbxl which is where the issue presents itself

the error should represent itself along the lines of

[LOGCHANNELS + 1] RBXCRASH: UniqueID collision detected (SessionID = <SESSION ID>, UniqueID = <UNIQUE ID>, new Instance = ReplicatedFirst.testscript copy (Guid = 0.207979), registered Instance = ReplicatedFirst.testscript (Guid = 0.207978))

Files
lune - reproduction.zip

Files lune - reproduction.zip

This looks to be missing the test script that build.sh is trying to run with Lune here:

	lune test $name $buildOutput $scriptOutput

Can you upload the zip again but include the Lune script?

That's odd, seems like it didnt zip all the files properly?
Here's a new zip. i double checked and it should be in there. If its not follow the below instructions

lune - reproduction.zip

add the next bit of code to a file called test.lua inside of the .lune folder thats supposed to be directly in the repository

local fs = require("@lune/fs")
local roblox = require("@lune/roblox")
local process = require("@lune/process")

function main()
	local rojoBuild = roblox.deserializePlace(fs.readFile(SCRIPTS_FILE)) :: DataModel
	local placeBuild = roblox.deserializePlace(fs.readFile("temp/Game.rbxl")) :: DataModel

	local rojoRep = rojoBuild:GetService("ReplicatedFirst")

	for _, instance in rojoRep:GetChildren() do
		instance.Parent = placeBuild:GetService("ReplicatedFirst")
	end

	local serializedGame = roblox.serializePlace(placeBuild)
	fs.writeFile("temp/ERROR.rbxl", serializedGame)
end

PLACE = process.args[1]
PLACE_FILE = process.args[2]
SCRIPTS_FILE = process.args[3]
main()

Reviewing the code now it seems like i forgot to remove unused variable, only SCRIPT_FILE ($scriptOutput) is used, thats my mistake

Fixed in version 0.7.6 by updating the relevant rbx-dom libraries