Iron-Stag-Games / Lync

Lync is a file sync tool for Roblox.
GNU Lesser General Public License v2.1
26 stars 3 forks source link

Instances ignore the names they're assigned in project.json #23

Closed knnyism closed 1 year ago

knnyism commented 1 year ago

For instances that are assigned a $path in the default.project.json file, upon modifying them, they seem to default to their file name, which causes them to duplicate, and sync to the wrong instance. (apologies if this sounds confusing, hopefully the reproduction steps clear things up)

To Reproduce:

  1. Have a project.json file that has an Instance with a $path property
{
  "name": "Ballistic",
  "tree": {
    "ReplicatedFirst": {
      "$className": "ReplicatedFirst",
      "ClientLoader": {
        "$path": "source/ballistic/game.client.luau"
      }
    }
  }
}
  1. Begin syncing, you should observe that initially the instance gets created with the proper name "ClientLoader", as also backed up by the logs
Mapping Instance 'tree/ReplicatedFirst/ClientLoader' -> [source\ballistic\game.client.luau]
Mapping Lua 'tree/ReplicatedFirst/ClientLoader' -> [source\ballistic\game.client.luau]
  1. Modify the file and notice how another instance is created called "game"
M [source\ballistic\game.client.luau]
Mapping Lua 'tree/ReplicatedFirst/game' -> [source\ballistic\game.client.luau]

image

  1. From this point any further modifications made to source\ballistic\game.client.luau will apply to ReplicatedFirst/game, rather than the expected ReplicatedFirst/ClientLoader

Note: I have only tested this with luau files, although I assume the same issue would persist with other formats as well.

hoontee commented 1 year ago

It's amazing this wasn't caught earlier. I'll get this fixed.

hoontee commented 1 year ago

Fixed! Please update to Alpha 15.4+ or enable automatic updates.