MemoryStoreService UpdateAsync not retried when previous value was nil

Sample code:

mss = game:GetService("MemoryStoreService")
test = mss:GetSortedMap("Test")
s = os.clock()
timeout = 3
task.spawn(function()
	print("spawn update", test:UpdateAsync("0", function(v) print("spawn received", v) return (v or 0) + 2 end, timeout))
	print("spawn", os.clock() - s)
end)
print("main update", test:UpdateAsync("0", function(v) print("main received", v) return (v or 0) + 1 end, timeout))
print("main", os.clock() - s)

Some of the time the two UpdateAsync transform functions will run at the same time and produce this output:

spawn received nil
main received nil
spawn update 2
spawn 0.1831044999999
main update 1
main 0.1833445999946

I printed out the value of the key after both finished and indeed it was ‘1’ (expected value: ‘3’)

Expected behaviour: It should run UpdateAsync a second time for one of the transform functions even when the previous value was nil (OR this behaviour should be documented so developers can avoid bugs!)

3 Likes

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

4 Likes

@chess123mate Thanks for reporting this issue, it should now be resolved.

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.