Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

refactor(redis): typed RedisReply instead of dynamic replies; move RedisConnectionTestFake out of lib

オープン
#1,571 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
dart, flutter, redis

調査の方向性

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 の本文から書いたものです。

説明

backend connections enhancement P3

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 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).
  • Pure refactor, no behaviour change; do it after #1569 (Redis DB-switch fix), which touches the same file.
主要言語
Dart
スター
23
フォーク
1
平均マージ
31分
マージ済み PR(30日)
570

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

QueryaHub/Querya-Desktop のほかの issue

QueryaHub/Querya-Desktop の issue をすべて見る

似ている issue

Dart の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。