evaera / roblox-lua-promise

Promise implementation for Roblox
https://eryn.io/roblox-lua-promise/
MIT License
281 stars 78 forks source link

Queued callbacks do not begin on new threads #31

Closed ArthurZC23 closed 4 years ago

ArthurZC23 commented 4 years ago

Description of the bug: The following error is thrown when yielding in the chain andThen after the resolution of Promise.delay: Promise:726: attempt to index nil with 'next' . Frequency of the error (in the this artificial example posted below): 100%

Reproduction steps

Run the following server script:

local ServerStorage = game:GetService("ServerStorage")

local Promise = require(ServerStorage.src.Promise)

Promise.delay(5):andThen(function ()
    wait(2)
end)
evaera commented 4 years ago

Thanks for the report, I discovered a previously unknown bug in the Promise library due to this!

ArthurZC23 commented 4 years ago

Yeah, I read the commit. I'm glad you found out and fix it so fast!