Skip to content

GlobalState in clientside return nil if Table is large. #1854

Open
@renzuzu

Description

@renzuzu

as instructed by bubble to produce repros here.

this issue cannot be reproduce on any existing Globalstate that already have a value. ( as trying to use the command in client side its only returned the old value , this is probably an issue too)

i can only reproduce with New GlobalState

Server:

RegisterCommand('fillgs', function()
	local stat = GlobalState.TEST or {} -- TEST is new
	for i = 1, 10000 do -- 10k to replicate a large table
		table.insert(stat,{
			data = 100000,
			data2 = 100000,
			data3 = 10000,
			data4 = 1000000,
			data5 = 1000000,
			data6 = 10000000,
			data7 = 10000000,
			data8 = 1000000,
		})
	end
	GlobalState.TEST = stat
end)

Server: to see the globalstate haves a data in server

RegisterCommand('vehiclestat', function() -- to see the globalstate have a data in server
	local stat = GlobalState.TEST
	for k,v in pairs(GlobalState.TEST) do
		print(k,v)
		--stat[k] = nil
	end
	GlobalState.TEST = stat
end)

Client:

RegisterCommand('vehiclestat2', function()
	for k,v in pairs(GlobalState.TEST) do
		print(k,v)
	end
end)

The Client Returned Nil value and produce and error.

i tought this is a default behavior of Oneysnc Globalstate. to prevent client receiving a large data sent from server.
but as i asked bubble, he said this could be a bug and need a repro.

im currently using Canary version of client and server artifact version 6183

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions