Can DataStores return corrupt data?

Just a quick question, lets say you had a saving format such as this:

local playerProfile = {
	data = {
		XP = 0;
		Level = 0;
		Rank = "idk"
	};
	
	profileLocked = false;
	lastLogIn = 0000000000
    -- ect...
}

If no data was returned by the DataStore call you would assume its a new player and result to the default values, however, would there ever be a case where you could get a player profile returned without the data being fully intact and without a error being thrown, so using the example above you could get a value for a rank but get nil or a string or something for the level. Is this something I should consider when making my DataStore system? I would try and test for these edge cases but I have no idea if that`s even possible and if this is even one of those cases. Thanks a lot if you can help :slight_smile:

This shouldn’t happen unless you save the malformed data yourself. If there’s an issue retrieving data, I’m pretty sure it should just error.

3 Likes

Ok thanks, im just trying to cover everything I could think of that could cause data loss because after browsing around on the forum there seem to be a lot of issues regarding losing data.