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
After updating from version 1.0.1 to version 2.0.0, the function kv.scanIterator() no longer works correctly. When using it in a for await loop, the loop never exits. It is not an infinite loop as it processes keys correctly, but it never reaches the return statement of the function.
Here is the code demonstrating the issue:
exportasyncfunctionstartRun(){console.log("Iniciando for");forawait(constkeyofkv.scanIterator()){constvalue=awaitkv.get(key);console.log({ key, value });console.log("ultima iteración del for");}return"Finalizando y retornando";}
The console.log statements execute correctly for each key found, but the loop never terminates, preventing the function from returning.
I attempted to resolve the issue by adding the following configuration:
After updating from version 1.0.1 to version 2.0.0, the function
kv.scanIterator()
no longer works correctly. When using it in afor await
loop, the loop never exits. It is not an infinite loop as it processes keys correctly, but it never reaches the return statement of the function.Here is the code demonstrating the issue:
The
console.log
statements execute correctly for each key found, but the loop never terminates, preventing the function from returning.I attempted to resolve the issue by adding the following configuration:
However, the problem persists. As a temporary workaround, I have reverted to version 1.0.1, where the function works as expected.
Steps to Reproduce:
@vercel/kv
from version 1.0.1 to version 2.0.0.kv.scanIterator()
in afor await
loop.Expected Behavior:
The
for await
loop should terminate after processing all keys and the function should return the expected result.Actual Behavior:
The
for await
loop processes keys correctly but never exits, preventing the function from returning.Environment:
@vercel/kv
version: 2.0.0Thank you for your assistance in resolving this issue.
The text was updated successfully, but these errors were encountered: