MemoryStoreHashMap:SetAsync() always returns false for no reason

I already see other people having the same issues but there seem to have no solutions to that yet, I’m pretty sure its not the problem with my code since it wont work no matter how I adjust the parameters.

Any help is appreciated!

1 Like

How are you calling it, give a code snippet.

1 Like
for i = 1, PROPERTIES.MaxAttempts do
	local success, result = pcall(function()
		if state == 0 then
			self._MemoryStore:RemoveAsync(key)
		else
			print(key, state, duration)
			bypassId = HTTP:GenerateGUID(false)
			local s = self._MemoryStore:SetAsync(key, {
				State = state, 
				BypassId = bypassId
			}, duration)
			print(s and "Succeed " or "Failed" .." on setting memory.")
		end
	end)
			
	if success then
		self.KeyStateChanged:Fire(key, translation2[tostring(state)])
		return true, (state ~= 0 and bypassId) or nil
	end

	if i ~= PROPERTIES.MaxAttempts then
		task.wait(PROPERTIES.AttemptInterval)
	end

	Result = result
end

Tell me if you need more

Wrap it in a pcall

local success, err = pcall(function()
    return self._MemoryStore:SetAsync(key, {
        State = state,
        BypassId = bypassId
    }, duration)
end)

print(success and "Succeed" or ("Failed on setting memory: " .. tostring(err)))
1 Like

The call itself wont give any error but the returned success value is simply false. when I check data with GetAsync() is returned nil