-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scan converts string cursors to a JavaScript number #2561
Labels
Comments
Will be fixed in v5, see here |
Cheers! Sounds like you can close this! Thanks for the quick direction! |
I'll leave it open for now... |
@fabiancook BTW, you can work around that by using const [cursor, keys] = await client.sendCommand(['SCAN', cursor, '...']);
// cursor = string, keys = Array<string>
const { cursor, keys } = await client.scan(cursor, options);
// cursor = number, keys = Array<string> |
Draft
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
It appears redis can return a cursor larger than the max safe integer of JavaScript.
I was getting a cursor returned
220792619452327820
, and when it was converted to a number, it was converted to220792619452327800
node-redis/packages/client/lib/commands/SCAN.ts
Line 31 in a7d5bc7
When I was reproducing this with ioredis, I first followed the same number type and converted the string to a number, but then realised thats where the problem was happening.
Node.js Version
v18.16.0
Redis Server Version
Server upstash_version:1.7.8 redis_version:6.2.6 redis_git_sha1:4004b61 redis_build_id:20230612 redis_mode:standalone
Node Redis Version
redis@4.6.7
Platform
macOS
Logs
Relevant cursor values:
The text was updated successfully, but these errors were encountered: