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
refactor(redis): typed RedisReply instead of dynamic replies; move RedisConnectionTestFake out of lib #1571
RedisConnection.sendCommand(List<dynamic> args) -> Future<dynamic> (lib/core/database/redis_connection.dart:391) passes raw redis package replies through. Every caller re-parses them by hand: 9 is List / length == 2 checks in redis_connection.dart alone (scan, getMaxDatabases, hash/zset/stream readers), plus redisReplyInt / RedisBulkValue.fromReply with fallbacks that hide a wrong reply shape (redisReplyInt(result, -1) turns an error into -1).
A Redis error reply and a wrong-type value look the same to callers, and arguments are List<dynamic>, so a non-string argument goes through unchecked.
RedisConnectionTestFake (:817, ~280 lines) lives in lib/ and ships in the release binary.
Fix
Parse once into a sealed RedisReply (RedisInt, RedisBulk(bytes), RedisSimple, RedisArray, RedisNil, RedisErrorReply) at the sendCommand boundary. Accessors like asInt() / asArray() throw a typed RedisProtocolException on a shape mismatch.
Typed arguments: List<Object> of String | int | Uint8List | RedisBulkValue, converted in one place (redisCommandArg).
Move RedisConnectionTestFake to test/ (or lib/testing/ excluded from the app).
Activity