DataStoreService can save userdata and other light userdata without errors

Reproduction Steps

System Information
Intel Core i9 9900K
16GB DDR5 RAM
Nvidia GeForce RTX 2080Ti

Example repro script

local ds = game:GetService("DataStoreService"):GetDataStore("TEST_STORE_003", "UNUSED_SCOPE_001") ds:SetAsync("UNUSED_TEST_KEY_002", OverlapParams.new()) print(ds:GetAsync("UNUSED_TEST_KEY_002"))

Full list of data types that don’t get saved and get saved: What types can Roblox store? · GitHub

Expected Behavior

Roblox throws an error when trying to save userdata/light userdata.

Actual Behavior

Roblox saves the userdata/light userdata and when trying to use GetAsync it returns nil

Issue Area: Engine
Issue Type: Other
Impact: Low
Frequency: Sometimes

4 Likes

Thanks for the report! We’ll follow up when we have an update for you.

1 Like

Any updates on this behaviour as it does not seem intended?

1 Like

Any updates on this behaviour as it does not seem intended? x2

1 Like

Hello! Thanks for the report.

Some types, including OverlapParams, are not savable in data stores. We’ve added more documentation to explain possible behaviors, which include storing nil without error.

To debug why your data type is being stored as nil, you can use the JSONEncode function. When you pass your Lua data type into this function, you receive it back in the format Roblox would have stored it with data stores, which lets you preview and investigate the returned data.