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
A new version of set-interval-async is available with improvements on error handling and including a bug fix. You may see the changes in more detail in the release notes.
I'm reaching out because I noticed an instance of the following pattern in your project (link), which may lead to undesired results:
consttimer=setIntervalAsync(async()=>{// ...if(/* some condition */){awaitclearIntervalAsync(timer);}},interval);
The code above generates a chaining promise cycle which never resolves, because:
await clearIntervalAsync(timer) will not resolve until the last execution has finished, AND
the last execution will not finish until await clearIntervalAsync(timer) has been resolved.
In aio-rek, the pattern is hidden in the following sequence: initFaceDetection > setIntervalAsync > clearFaceDetection > clearIntervalAsync. Simply not awaiting clearIntervalAsync may be enough to avoid this issue, but the right solution will depend on your application's requirements. This didn't surface earlier due to the bug in set-interval-async that has now been fixed in the latest major version.
Best,
Emilio
The text was updated successfully, but these errors were encountered:
Hi @jefrydco.
A new version of set-interval-async is available with improvements on error handling and including a bug fix. You may see the changes in more detail in the release notes.
I'm reaching out because I noticed an instance of the following pattern in your project (link), which may lead to undesired results:
The code above generates a chaining promise cycle which never resolves, because:
await clearIntervalAsync(timer)
will not resolve until the last execution has finished, ANDawait clearIntervalAsync(timer)
has been resolved.In aio-rek, the pattern is hidden in the following sequence:
initFaceDetection > setIntervalAsync > clearFaceDetection > clearIntervalAsync
. Simply not awaitingclearIntervalAsync
may be enough to avoid this issue, but the right solution will depend on your application's requirements. This didn't surface earlier due to the bug in set-interval-async that has now been fixed in the latest major version.Best,
Emilio
The text was updated successfully, but these errors were encountered: