-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redis Client: fix NPE when constructing XPendingSummary #45687
Redis Client: fix NPE when constructing XPendingSummary #45687
Conversation
Certain fields that were deemed to be mandatory can in fact be `null`, as demonstrated in newly added tests. Also, this commit fixes translating `XTrimArgs` to the actual argument array in case `MAXLEN` is set to `0`. That is, in fact, a valid value, as demonstrated by the newly added tests and also by inspecting Redis source code [1]. [1] https://github.com/redis/redis/blob/7.2.4/src/t_stream.c#L941
Status for workflow
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a small question but in general LGTM.
I will let @cescoffier approve and merge though.
consumers.put(nested.get(0).toString(), nested.get(1).toLong()); | ||
if (r.get(3) != null) { | ||
for (Response nested : r.get(3)) { | ||
consumers.put(nested.get(0).toString(), nested.get(1).toLong()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In there we are sure the values are not null? If so, LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure that both the keys and the values are never null
, but not completely, to be honest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
me neither - it's not really said on the command documentation. I think it's good to go.
consumers.put(nested.get(0).toString(), nested.get(1).toLong()); | ||
if (r.get(3) != null) { | ||
for (Response nested : r.get(3)) { | ||
consumers.put(nested.get(0).toString(), nested.get(1).toLong()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
me neither - it's not really said on the command documentation. I think it's good to go.
Certain fields that were deemed to be mandatory can in fact be
null
, as demonstrated in newly added tests.Also, this commit fixes translating
XTrimArgs
to the actual argument array in caseMAXLEN
is set to0
. That is, in fact, a valid value, as demonstrated by the newly added tests and also by inspecting Redis source code [1].[1] https://github.com/redis/redis/blob/7.2.4/src/t_stream.c#L941
Fixes #45682