The IsFinished property on DataStores is never set to “True” even when we’re on the last page. The :AdvanceToNextPageAsync() method fails silently and we never finish iterating over the datastore. This duplicates data and results in a ton of errors.
local DataStoreService = game:GetService("DataStoreService")
local orderedDataStore = DataStoreService:GetOrderedDataStore("test_store")
orderedDataStore:SetAsync("entry_key", 1)
task.wait(1)
local dataStorePages = orderedDataStore:GetSortedAsync(false, 100)
local pageData = dataStorePages:GetCurrentPage()
local iterations = 10
while pageData and iterations > 0 do
iterations -= 1
print(dataStorePages.IsFinished) --> false (always, 10 times)
dataStorePages:AdvanceToNextPageAsync()
pageData = dataStorePages:GetCurrentPage()
end