refactor(redis): typed RedisReply instead of dynamic replies; move RedisConnectionTestFake out of lib
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 35/100
研究方向
Start with lib/core/database/redis_connection.dart, especially sendCommand at line 391 and the reply parsing sites named in the issue. Then review #1569, which touches the same file and is a prerequisite. The refactor is done when replies and command arguments are typed at the boundary, the test fake is moved out of lib/, and existing behavior is preserved.
由索引模型根據 Issue 內容生成。
描述
Problem
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 thesendCommandboundary. Accessors likeasInt()/asArray()throw a typedRedisProtocolExceptionon a shape mismatch. - Typed arguments:
List<Object>ofString | int | Uint8List | RedisBulkValue, converted in one place (redisCommandArg). - Move
RedisConnectionTestFaketotest/(orlib/testing/excluded from the app). - Pure refactor, no behaviour change; do it after #1569 (Redis DB-switch fix), which touches the same file.
- 主要語言
- Dart
- 星號
- 23
- 分支
- 1
- 平均合併
- 31 分鐘
- 30 天內合併 PR
- 570
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
QueryaHub/Querya-Desktop 的其他 Issue
-
enhancement ui
難度 2/5 1-3 小時 新手友好度 78/100
QueryaHub/Querya-Desktop#1689 ·
維護者通常 1 天內回覆
-
ui(dialogs): make destructive query and DML preview dialogs adaptive and prevent table name overflow未關閉bug frontend
難度 2/5 1-3 小時 新手友好度 82/100
QueryaHub/Querya-Desktop#1642 ·
維護者通常 1 天內回覆
-
bug error-handling settings
難度 1/5 1-3 小時 新手友好度 78/100
QueryaHub/Querya-Desktop#1637 ·
維護者通常 1 天內回覆
-
enhancement
難度 1/5 1 小時以內 新手友好度 88/100
QueryaHub/Querya-Desktop#1636 ·
維護者通常 1 天內回覆
-
enhancement marketplace
難度 2/5 1-3 小時 新手友好度 78/100
QueryaHub/Querya-Desktop#1635 ·
維護者通常 1 天內回覆
查看 QueryaHub/Querya-Desktop 的全部 Issue
相似的 Issue
-
enhancement
難度 2/5 1-3 小時 新手友好度 64/100
0niel/university-app#617 ·
維護者通常 1 天內回覆
-
enhancement
難度 2/5 1-3 小時 新手友好度 70/100
linagora/tmail-flutter#5010 · 1 則留言 ·
維護者通常 1 天內回覆
-
bug
難度 1/5 1 小時以內 新手友好度 65/100
chriskelly/wish-together#36 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
AppFlowy-IO/AppFlowy#9075 ·
-
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆