ProfileService not detecting new addition of tables

I’m using ProfileService and it does not detect new addition to the template data.

If a player joins, and I only have 3 tasks, it’s fine

Tasks = {
		[1] = {Progress = 1, Amount = 0, Complete = false},
		[2] = {Progress = 1, Amount = 0, Complete = false},
		[3] = {Progress = 1, Amount = 0, Complete = false},
	},

But if in future updates I wanna add more tasks, it breaks

Tasks = {
		[1] = {Progress = 1, Amount = 0, Complete = false},
		[2] = {Progress = 1, Amount = 0, Complete = false},
		[3] = {Progress = 1, Amount = 0, Complete = false},
        [4] = {Progress = 1, Amount = 0, Complete = false},
        [5] = {Progress = 1, Amount = 0, Complete = false},
	},

It doesn’t detect the new tasks, and thus older players are stuck with just 3 tasks :confused:

2 Likes

I wouldn’t say that this behavior is an issue, Profile:Reconcile() just only checks for missing keys on the root table. This behavior is pretty fair in my opinion, especially when the keys for your Tasks table are just integers… if it tried to reconcile these too it could have unexpected/unwanted behavior if you removed an existing task from the default data.

That being said, it would be pretty simple to write your own logic for reconciling the missing tasks when the profile is first loaded. There is a basic example of modifying profiles on load in the ProfileService docs

1 Like