Using Drafts, Packages, and Monolithic Scripts together causes major corruption and lost work

Reproduction Steps

The “Merge Conflicts” dialog is very troublesome and buggy when working on a large, monolithic script that is also a package. Today, this has just caused major corruption of my edits when working with another programmer in Team Create, and forced me to manually resolve these conflicts using git in a very tedious process.

We may have to disable Collaborative Editing completely in order to resolve this issue. Git + Rojo is not an option for this project because of extenuating circumstances.

Reproduction steps:

  • Start with this place file:
    MonolithDraftResolutionRepro.rbxl (52.4 KB)

  • Upload this place to Roblox as a new experience, and enable team create (View → Team Create → Turn On)

  • Enable Collaborative Editing on this team create place (Home → Game Settings → Other → Enable Collaborative Editing), then restart Roblox Studio. Make sure nobody is in the Team Create server for ~20 seconds.

  • Open studio again and open the following script in workspace:
    image

This boatbomber’s HashLib library as sample code, with modifications to make it over 8000 lines long. This simulates the game that I am actually currently working on.

  • Right click this script and select “Convert to package.” Finish the package upload dialog.

  • Invite an alternate account to the same Team Create, and join the team create on another device, running roblox studio as two separate accounts:
    image

  • Open the HashLib script in workspace on both devices running Studio

  • On User 1’s computer, edit line 2605 to add a comment with the following:

		local result -- An Edit on Line 2605 by User 1

  • On User 2’s computer, edit line 2999 to add a comment with the following:
				pos = pos + 4 -- An Edit on Line 2999 by User 2
  • On User 1’s computer, commit changes to the HashLib library in the Drafts widget:
    image

  • On User 2’s computer, select “Merge from server”

Imgur

BUG: Merge dialog says there’s no conflicts on this script!

The first think you’ll notice is that there are conflicts listed by this dialog. Clicking “Previous”, “Next”, and “Next Unresolved” does not do anything.

You can click “Preview Resolution”; The resolution previewed will always show User 1’s Addition plus User 2’s addition, regardless of how Draft or Server is checked. However, without any of the highlighting, this is impossible to navigate your changes VS User 1’s on a large monolithic script in this tiny scrollable box with grey code barely-visible.

Clicking “Edit” to manually resolve the conflict crashes studio.

** The final merged draft will always contain both User 1’s additions/removals AND User 2’s additions/removals, regardless of whether “Server” or “Draft” are selected. This is because these are meant for line-by-line merges, the merge dialog is not actually detecting any changes.**

In my actual example, because I edited a large number of lines at once, I ended up with a single draft that included both the other person’s additions/removals, and my own when merging with the server.

This caused major corruption to my changes which stopped the game from loading at all, with no errors, and I need to run a git diff to parse out which work was mine and which work was my coworker’s. On an 8000 line monolithic script, where we were both changing a lot of things at once.

I’m assuming my drafts containing his edits was related to this issue: Drafts can be committed onto out-of-date packages with no option to resolve merge conflicts ?

On top of all this, I am noticing that my coworker’s changes sometimes get merged onto mine without ever opening the merge conflict dialog, and I am staged to commit his changes in my own draft. I cannot find a way to reproduce that; it is simply something I am noticing a lot. It may have something to do with package update order, playtesting, and other factors. I can give a place file or experience/place link for this to a Roblox admin, but it is very difficult to reproduce that issue.

Side note (mostly for the unreproducible parts of this bug): We usually only publish changes to the package close to release of the game, and upon investigating this issue, I can confirm that nobody ever published a change to any package while we were working on our respective features.

Expected Behavior

Merge conflict dialog should always show changes, whether or not the script being edited has a package link under it.

Actual Behavior

Big scripts (all scripts??) with package links have major issues with merge conflicts (reproduced in this report), other people’s drafts merging onto your own without your consent (can’t seem to reproduce), and other unpredictable issues.

Workaround

Turn off collaborative editing (what we may have to do, which is also super annoying when working on a big monolithic script), a major refactor to code division (planned, but will take a lot of time), or using Rojo to sync files in a safer way.

Issue Area: Studio
Issue Type: Other
Impact: Critical
Frequency: Often
Date First Experienced: 2022-07-06 00:07:00 (-06:00)
Date Last Experienced: 2022-07-07 00:07:00 (-06:00)
A private message is associated with this bug report

5 Likes

I’ve seen this bug around for at least a year and it’s pretty frustrating. Frankly I should have reported it sooner, but I think I kind of just gave up on trying to work with Roblox’s merge tools.

3 Likes

Thanks for the report ! We are aware of this issue and will let you know if there’s any update.

2 Likes

I think this should be resolved, sorry for the late response - is anyone still having issues?

1 Like