You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 29, 2025. It is now read-only.
I have referenced available documentation and cannot resolve the issue
I'm certain this is an issue with oxymysql, and not with my resource
Describe the bug
The 2.1.1 release, used to return the promise automatically created by an async function.
from 2.2.0 and above, the return is now a new promise, which doesn't reject when an error occur.
Screenshots
(2.1.1 version)
(Latest)
Code
-- creating a incorrect query on purpose to catch with pcallCreateThread(function()
localox=exports.oxmysqllocalok, err=pcall(ox.query_async, ox, 'SELECT')
print(ok, err)
end)
Expected behavior
Reject the promise, and catch the error using pcall or try { } catch on javascript
Additional context
The 2.2.0 release replaced the old return statement to returning a new promise, which doesn't call reject, the lua coroutine is hanging forever, since the promise is never resolved.
Not sure but this behavior may cause memory leak as well, since the coroutine will wait forever.