You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using a method named Do on a Pipeliner object we expect to 'do' said Pipeliner instead of 'add new command'
Without reading the source, the impression, when seeing the prototype of the method and its name, is that it will produce a Cmd interface representing the Pipeliner.
The alternative expected behavior would be that if no arguments are given, Do would return an error command.
This way the user knows he is misusing the Pipeliner object.
Current Behavior
Currently if given no arguments it creates a nop command, adds it to the list of commands and returns that nop command.
If the user tried to use .Result() on that command he will get an empty response.
Possible Solution
Rename Do into Create. Technically Do does nothing
If args is empty, create a new Cmd, use SetError on it and return it
A similar piece of code turned in production for many months and only discovered after a week of investigation.
None of the reviewers caught the issue during the review process.
Rename Do into Create. Technically Do does nothing
Do executes the command when used with the plain Redis client. It has a different meaning when used with a Pipeliner, but that's true for all other commands as well.
Expected Behavior
Using a method named
Do
on aPipeliner
object we expect to 'do' said Pipeliner instead of 'add new command'Without reading the source, the impression, when seeing the prototype of the method and its name, is that it will produce a
Cmd
interface representing the Pipeliner.The alternative expected behavior would be that if no arguments are given,
Do
would return an error command.This way the user knows he is misusing the
Pipeliner
object.Current Behavior
Currently if given no arguments it creates a nop command, adds it to the list of commands and returns that nop command.
If the user tried to use
.Result()
on that command he will get an empty response.Possible Solution
Do
intoCreate
. TechnicallyDo
does nothingSteps to Reproduce
Context (Environment)
A similar piece of code turned in production for many months and only discovered after a week of investigation.
None of the reviewers caught the issue during the review process.
Detailed Description
Possible Implementation
If renaming is too much of a pain:
The text was updated successfully, but these errors were encountered: