Reproduction Steps
local DataStoreService = game:GetService("DataStoreService")
JogoStore = DataStoreService:GetDataStore("Jogo")
for i = 1, 3 do -- create 3 keys
JogoStore:SetAsync(i, i*10)
end
function ListAllKeys(DS, Operation)
print("\n***ListAllKeys(DS, Operation): ", DS, Operation)
local DSoptions = Instance.new("DataStoreOptions")
DSoptions.AllScopes = true
local DataStore = DataStoreService:GetDataStore(DS, "", DSoptions)
local Success, Pages = pcall(function()
return DataStore:ListKeysAsync('global', nil, nil, true) -- true = excludeDeleteda
end)
if Success then
while true do
local Itens = Pages:GetCurrentPage()
for _, Key in ipairs(Itens) do
if Operation == 'Remove' then
local Success, Erro = pcall(function()
local Result = DataStore:RemoveAsync(Key.KeyName) -- remove conteúdo da chave
print('Remove', Key.KeyName)
end)
if not Success then
warn(Erro)
end
else
local Value, KeyInfo = DataStore:GetAsync(Key.KeyName)
print('Key.KeyName, Value, KeyInfo', Key.KeyName, Value, KeyInfo)
end
end
if Pages.IsFinished then
break
end
repeat
local Success, Errormessage = pcall(function()
Pages:AdvanceToNextPageAsync()
end)
if not Success then
warn('Error')
warn(Errormessage)
wait(1)
end
until Success
end
end
end
ListAllKeys('Jogo')
ListAllKeys('Jogo', 'Remove')
ListAllKeys('Jogo')
Expected Behavior
Last week Release Notes for 565 | Roblox Creator Documentation was released where it is reported that ListKeysAsync
has a new parameter to correct a bug reported 6 months ago (there is a typo there, as reported here):
The script above is exactly the same as mentioned in a bug report from 6 months ago.
The only difference that the true
parameter was inserted inside the ListKeysAsync
line.
Actual Behavior
As shown in the original script:
- 3 keys are created in a DS
- The 3 keys created above are listed
- The 3 keys are removed
- Even removed, the 3 keys are still listed.
Changing the line from:
return DataStore:ListKeysAsync('global')
to
return DataStore:ListKeysAsync('global', nil, nil, true)
I get this:
Issue Area: Engine
Issue Type: Other
Impact: High
Frequency: Constantly
Date First Experienced: 2023-03-02 00:03:00 (-03:00)