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 }}
Repository navigation
INCRBY return 'number', exceeding JavaScript's MAX_SAFE_INTEGER causes precision loss #2000
I've encountered an issue related to data type handling for integer-based commands. Redis supports 64-bit signed integers, which can grow much larger than JavaScript's Number.MAX_SAFE_INTEGER (2^53 - 1).
Currently, commands like INCRBY return a standard JavaScript number. This can lead to a silent loss of precision when the integer value stored in Redis exceeds this limit. This is problematic for applications that rely on ioredis for accurate atomic counting with large numbers, such as leaderboards, distributed counters, or financial systems.
Activity
nkaradzhov commentedon Aug 7, 2025
Hi @bian0726, thanks for reporting this issue! We are gonna look into it.
PavelPashov commentedon Aug 12, 2025
Hey @bian0726, you can enable the stringNumbers option and then parse the returned string
bian0726 commentedon Aug 13, 2025
@PavelPashov Thanks for the solution, I'll try using it.