Skip to content

fix(client): type ACL GETUSER flags as RESP3 SET - #3417

Open
abhijeet117 wants to merge 1 commit into
redis:masterfrom
abhijeet117:fix/acl-getuser-flags-set-reply
Open

fix(client): type ACL GETUSER flags as RESP3 SET#3417
abhijeet117 wants to merge 1 commit into
redis:masterfrom
abhijeet117:fix/acl-getuser-flags-set-reply

Conversation

@abhijeet117

@abhijeet117 abhijeet117 commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Summary

ACL GETUSER declares flags as an array, but Redis emits the flags element with setDeferredSetLen in acl.c, so RESP3 clients receive a SET on the wire and get a runtime Set typed as string[]. Sibling commands already model this shape with SetReply (FUNCTION LIST, CLIENT TRACKINGINFO). flags is now SetReply: RESP2 replies stay arrays, RESP3 replies type as Set.

Testing

Compile-time regression test resolves the reply under a SET type mapping and asserts flags is Set; it fails on master with TS2740 and passes after the fix. Verified against acl.c source; parser spec, type tests, build and lint run locally; Docker-backed integration tests run in CI.

Checklist

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

Note

Low Risk
Type-only reply mapping change with no runtime parser or command behavior updates. Possible TypeScript breakage for callers that treated RESP3 flags as an array.

Overview
Corrects ACL GETUSER reply types so flags is a RESP3 set, matching what Redis actually sends (setDeferredSetLen in acl.c). Previously it was typed as an array, so RESP3 clients got a runtime Set while TypeScript claimed string[].

flags is now SetReply<BlobStringReply> (same pattern as FUNCTION LIST and CLIENT TRACKINGINFO). RESP2 replies stay arrays. A compile-time types test asserts flags is Set<string> under a SET type mapping.

Reviewed by Cursor Bugbot for commit 009c10b. 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: 009c10b47f

ℹ️ 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".


type AclUser = TuplesToMapReply<[
[BlobStringReply<'flags'>, ArrayReply<BlobStringReply>],
[BlobStringReply<'flags'>, SetReply<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 Keep RESP2 flags typed as an array

When a RESP2 client uses .withTypeMapping({ [RESP_TYPES.SET]: Set }), Resp2Reply<AclUser> preserves this nested value's new SET tag, so aclGetUser() now declares flags as Set<string>. The RESP2 server still sends an ARRAY and the decoder returns an array—the existing integration assertion confirms this—so consumers can compile Set-only operations that fail at runtime. Give the RESP2 transform an explicitly array-typed flags result rather than sharing the RESP3 marker.

AGENTS.md reference: AGENTS.md:L49-L51

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