fix(client): correct XINFO GROUPS last-delivered-id reply type - #3410
Open
abhijeet117 wants to merge 1 commit into
Open
fix(client): correct XINFO GROUPS last-delivered-id reply type#3410abhijeet117 wants to merge 1 commit into
abhijeet117 wants to merge 1 commit into
Conversation
Contributor
|
@abhijeet117 Thanks for the PR. We’ll review it when we have capacity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The XINFO GROUPS reply type declared last-delivered-id as a number, but Redis sends a stream entry ID string (for example "0-0"), so TypeScript consumers saw the wrong primitive type and could hit runtime errors treating it as numeric. This labels it BlobStringReply, matching XINFO STREAM's last-generated-id and the runtime value already asserted by the XINFO GROUPS integration spec.
Testing
Reproduced at compile time: with the old declaration, groups[0]['last-delivered-id'] resolves to number and assigning it to string fails tsc. Added packages/client/types-tests/xinfo-groups.types-test.ts which fails before the fix and passes after. Ran test:types, lint and the client package build locally; full suites run in CI.
Checklist
Note
Low Risk
Type-only correction plus a compile-time test; no runtime or protocol behavior changes.
Overview
Fixes the
XINFO GROUPSreply type solast-delivered-idis a stream ID string (BlobStringReply), not a number. Redis returns values like"0-0"; the oldNumberReplydeclaration made TypeScript treat it asnumber.Adds a compile-time types test that asserts the field is assignable to
stringand not tonumber.Reviewed by Cursor Bugbot for commit 73905e3. Bugbot is set up for automated code reviews on this repo. Configure here.