LogService.MessageOut discards alphanumeric substrings inside pairs of forward slashes

Certain substrings are being removed when MessageOut receives them. Here’s a list of example output and resulting strings with the current behavior:

  • /foo/
  • /foo/barbar
  • /a1b2c3d4/
  • /a1b2c3d4/barbar
  • /foo a/
  • /foo/foo
  • /foo ab//foo ab/
  • //////
  • !@#$%!@#$%
  • /123 45//123 45/

It seems like if the substring enclosed within pairs of / begins with an alphanumeric character, it isn’t included unless it has a space followed by two characters.

Here’s a script you can run in the command bar to reproduce this:

local LogService = game:GetService("LogService")

local outputs = {}

local connection = LogService.MessageOut:Connect(function(message)
	table.insert(outputs, message)
end)

local examples = {
	"/foo/",
	"/foo/bar",
	"/a1b2c3d4/",
	"/a1b2c3d4/bar",
	"/foo a/",
	"/foo",
	"/foo ab/",
	"///",
	"!@#$%",
	"/123 45/",
}

for _, example in examples do
	print(example)
	task.wait()
end

connection:Disconnect()

for i, originalString in examples do
	if outputs[i] ~= originalString then
		print(`❌ {outputs[i]} != {originalString}`)
	else
		print(`✅ {outputs[i]} == {originalString}`)
	end
end

Here’s a place with that script in it:
MessageOutRepro.rbxl (54.3 KB)

3 Likes

Thanks for the report! I filed a ticket in our internal database and we’ll follow up when we have an update for you.

Hi @nomer888 , this is by design as a byproduct of an older issue where we needed to plug a security hole around file paths. What kind of use case does this behavior prevent for you?

Thanks for the update! I use jest-lua which, unless you disable it, outputs with ANSI color codes. Since I use jest in Studio and would like to keep chalk output for readability, I have a script that listens to MessageOut and ‘renders’ it in a story. Certain bits of text (like file or table paths) are missing as a result of this.

I haven’t tried it yet, and it’s not preferable, but I think a workaround could be to patch jest to avoid using print altogether. It was very confusing chasing down the cause of this bug, though - definitely unexpected behavior.