Skip to content

fix(client): correct HELLO modules reply type - #3411

Open
abhijeet117 wants to merge 1 commit into
redis:masterfrom
abhijeet117:fix/hello-modules-reply-type
Open

fix(client): correct HELLO modules reply type#3411
abhijeet117 wants to merge 1 commit into
redis:masterfrom
abhijeet117:fix/hello-modules-reply-type

Conversation

@abhijeet117

@abhijeet117 abhijeet117 commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

The HELLO reply type declared modules as an array of strings, but Redis sends one structured entry per loaded module: name and ver, plus path and args since 7.0. Consumers had no type-safe access to these fields. This declares the entries with the same TuplesToMapReply shape used by MODULE LIST, matching addReplyLoadedModules in the server.

Testing

Reproduced at compile time: with the old declaration, each module entry resolves to string and accessing name or ver fails tsc. Added packages/client/types-tests/hello.types-test.ts, which fails before the fix and passes after; it also covers the flat RESP2 form of the entry. Ran test:types, lint and the client package build locally; full suites run in CI.

Checklist

  • bug reproduced before fix
  • root cause identified
  • bug fixed
  • tests passed

Note

Low Risk
Type-only change to the HELLO reply declaration plus a compile-time test; no runtime or protocol behavior is modified.

Overview
Corrects the HELLO reply type so modules is an array of structured entries (name, ver, and Redis 7.0+ path/args) instead of an array of strings. That matches what Redis actually returns and lets consumers access those fields with type safety.

Adds a compile-time types test that asserts mapped RESP3 entries expose those fields and that ver is a number.

Reviewed by Cursor Bugbot for commit 10b540a. Bugbot is set up for automated code reviews on this repo. Configure here.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 10b540ac92

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +24 to +26
[BlobStringReply<'path'>, BlobStringReply],
/** added in 7.0 */
[BlobStringReply<'args'>, ArrayReply<BlobStringReply>]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Mark the pre-Redis-7 module fields optional

When HELLO is issued to Redis 6.x with a loaded module, module entries contain name and ver but not the path and args fields that these comments identify as added in 7.0. Declaring both fields as required therefore lets consumers dereference entry.path or entry.args as non-null values even though they are absent at runtime; this command's existing integration coverage still explicitly includes Redis 6.2, so these fields should be optional or represented by a version-aware union.

Useful? React with 👍 / 👎.

@PavelPashov

Copy link
Copy Markdown
Contributor

@abhijeet117 Thanks for the PR. We’ll review it when we have capacity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants