Long strings in UpdateSourceAsync times out Team Create session

When using UpdateSourceAsync with a large amount of data (in my scenario, ~10MB), the Team Create session will time out with the data not being fully appended to the source script. This becomes an issue for me because I am using Rojo, as well as a script that is compiled from web assembly. I understand what I am doing is not a very normal use-case, but this creates a conflict with a future feature we are making for our experience.

Reproduction Steps:

  • Open a new studio file.
  • Save the studio file to Roblox with team create enabled. Ensure that drafts are turned off.
  • Create a Script anywhere, in my case it is ServerScriptService.
  • Using UpdateSourceAsync, apply a LARGE amount of data to the Script.
  • After ~60 seconds, you will be kicked out of studio.

Here is an example code snippet you can run in the command bar, just ensure you have a script selected when running it.

local ReallyLongString = `local ExampleString="{string.rep("ABC123", 10_000_000)}"`

print("Appending to the script...")

game:GetService("ScriptEditorService"):UpdateSourceAsync(
    game.Selection:Get()[1], 
    function() 
        return ReallyLongString 
    end
)

print("Fully appended!")

Video Reproduction:

Here is a few pictures of my scenario with Rojo, which also uses UpdateSourceAsync:
RobloxStudioBeta_kESizEoQuo
RobloxStudioBeta_iFyuZtSsMH
dwm_3nhdwnKkeM

The amount of characters in my scenario:
RobloxStudioBeta_IUcUYDKrEj

Expected behavior

The UpdateSourceAsync should go through without yielding, and fully append the content to the script. A delay is expected, but timing out results in the update to cancel and not fully append, if at all.

1 Like

To be clear, your repro actually calls UpdateSourceAsync with a 60+ MB string. That is well in excess of the maximum supported property size (20MB).

UpdateSourceAsync works with a 10 MB string in my tests, though it might be connection dependent. Your best bet is probably inserting the script from a lua file through the Studio UI - bypassing live scripting and the script editor infrastructure entirely. You could also try splitting the script source into multiple pieces and recombining them on the server, and loading the result with loadstring. Aside from those workarounds, we just don’t support scripts this big. In my testing, I can’t even a 60 MB to replicate at all - even inserting it from a lua file through the Studio UI doesn’t work.

That’s my fault for the reproduction script. When I was using Rojo, the script was 10.7 MB from what the Windows properties menu showed. It might be due to the place file I am in during team create being very extensive, as there is a lot of instances.

This consistently occurred, until ironically enough, just now when I went to go and record it. Now I’m not too sure. This is the source code for the file that was initially causing this issue.