handle lpop and rpop with a count higher than 1#7
Conversation
|
Reporting for duty, captain! And maybe a snack? We're scanning your PR for issues. Stand by for comments. Lots of love, |
There was a problem hiding this comment.
Scanned on Aug 15th 2025, 04:46PM for commit f5cadeb8cbf86b9258affd9c94aaac00e45da67a
Rover found 1 risk.
1 medium.
One medium severity issue was found. The error handling for empty arrays has changed from returning Error(NotFound) to returning Ok([]), which could cause unexpected behavior in client code expecting the previous behavior.
Other Issues
We could not match the following issues to corresponding files within the code changes
The error handling for empty arrays has changed from returning `Error(NotFound)` to returning `Ok([])`, which could cause unexpected behavior in client code expecting the previous behavior.
Severity medium
Description
The PR modifies `lpop` and `rpop` to use `expect_bulk_string_array` for response handling. The previous implementation specifically had a case for `[resp.Array([])]` that returned `Error(NotFound)`, but this case is missing from `expect_bulk_string_array`. When an empty array is returned from Redis, the function will now return `Ok([])` instead of `Error(NotFound)`, changing the behavior for empty lists.Suggested fix
fn expect_bulk_string_array(
value: List(resp.Value),
) -> Result(List(String), Error) {
case value {
[resp.Array(array)] ->
case array {
[] -> Error(NotFound)
_ ->
list.try_map(array, fn(item) {
case item {
resp.BulkString(str) -> Ok(str)
_ ->
Error(
RespError(resp.error_string(expected: "bulk string", got: [item])),
)
}
})
}
[resp.Null] -> Error(NotFound)
_ -> Error(RespError(resp.error_string(expected: "array", got: value)))
}
}
To request another review, comment @rover-app review in the PR discussion.
Rover Support
Rover has scanned for issues in performance, security, reliability that might be introduced by this PR, in the context of your upstream and downstream services and dependencies.
What happens next
You can re-request a review by commenting @rover-app review on the PR.
Rover will review the PR again, and close any alerts that you've fixed.
I want to follow up with Rover
PR chat is coming
Soon, you'll be able to talk to Rover about issues in your PR, in your PR.
Right now, we only support code chat on your `main`/`master` (default) branch:
head to the graph page on the Rover platform
to chat with your code.
If Rover isn't doing much
It could be that Rover doesn't support your language or framework yet, or perhaps you've found an area we can improve in!
We'd love to get your feedback to help improve Rover, so if you're not happy with its output please get in touch by clicking here.
I love/hate the alerts Rover is generating
Regardless, we'd love to hear it!
We're working hard to make Rover better,
so please get in touch with us
with your PR number and alert comment.
I'd like to request a feature or improvement
You know the score: get in touch!
We love to have feature requests from our users to work on.
Rover actions
Re-review
Comment @rover-app review on the PR to request another review.
Suspend Rover scanning
To stop Rover from scanning PRs on your org (Pevensie), head to your organization settings or suspend the GitHub app installation on this GitHub account.
Closes #6