Skip to content

fix(client): handle ACL GETUSER null reply for nonexistent users - #3413

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

fix(client): handle ACL GETUSER null reply for nonexistent users#3413
abhijeet117 wants to merge 1 commit into
redis:masterfrom
abhijeet117:fix/acl-getuser-null-reply

Conversation

@abhijeet117

@abhijeet117 abhijeet117 commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

ACL GETUSER replies null when the user does not exist, but the declared reply type claimed a non-null object shape and the RESP2 transformer crashed indexing into the null reply (TypeError: Cannot read properties of null (reading '1')), as reported in #2745.

The RESP2 transformer now passes a null reply through unchanged, and NullReply is part of the declared reply type for both protocols, following the existing FUNCTION_STATS pattern.

Testing

Reproduced the crash by calling the RESP2 transformer with a null reply on master; it throws the exact TypeError from #2745. Added a unit assertion that the transformer returns null unchanged, plus compile-time regression tests asserting null is part of the client-facing reply type for both protocols (npm run test:types -w @redis/client fails before this change, passes after).

Checklist

  • Bug reproduced before fix
  • Root cause identified
  • Bug fixed
  • Tests passed

Note

Low Risk
Narrow reply-transform and type fix for one command; no auth, protocol, or data-path changes beyond correctly returning null.

Overview
Fixes ACL GETUSER crashing on RESP2 when the user does not exist (TypeError from indexing into null), and types the reply as nullable for both RESP2 and RESP3 (#2745).

The RESP2 transformer now returns null unchanged via isNullReply. Adds a unit check for that path and a compile-time types test that null is part of the client-facing reply.

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

@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