Skip to content

Refactoring #1226

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

Open
wants to merge 33 commits into
base: master
Choose a base branch
from

Conversation

ephraimfeldblum
Copy link
Collaborator

No description provided.

@@ -1740,22 +1696,11 @@ where
pub fn json_clear<M: Manager>(manager: M, ctx: &Context, args: Vec<RedisString>) -> RedisResult {
let mut args = args.into_iter().skip(1);
let key = args.next_arg()?;
let paths = args.try_fold::<_, _, Result<Vec<Path>, RedisError>>(
Copy link
Collaborator Author

@ephraimfeldblum ephraimfeldblum Aug 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iddm I believe this to be a bug. This try_fold implies that multiple paths may be passed to JSON.CLEAR, even though only the first will ever be used. And that if, for any path arg, if arg.try_as_str().is_err() then the function shall return early. Even if there was a legal path that was passed. Whereas the documentation clearly states that, at most, one singular path may be passed.

If anything, I believe the args length should be checked, and if it is not correct, then return Err(WrongArity).

@ephraimfeldblum ephraimfeldblum requested a review from iddm August 8, 2024 18:04
Copy link

codecov bot commented Aug 11, 2024

Codecov Report

Attention: Patch coverage is 93.48470% with 66 lines in your changes missing coverage. Please review.

Project coverage is 77.31%. Comparing base (04551a9) to head (b2a1505).
Report is 16 commits behind head on master.

Files with missing lines Patch % Lines
json_path/src/json_path.rs 80.80% 24 Missing ⚠️
redis_json/src/key_value.rs 91.91% 11 Missing ⚠️
json_path/src/json_node.rs 37.50% 10 Missing ⚠️
redis_json/src/ivalue_manager.rs 95.37% 10 Missing ⚠️
redis_json/src/backward.rs 76.47% 4 Missing ⚠️
redis_json/src/commands.rs 99.14% 4 Missing ⚠️
redis_json/src/c_api.rs 0.00% 2 Missing ⚠️
redis_json/src/redisjson.rs 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1226      +/-   ##
==========================================
- Coverage   78.37%   77.31%   -1.06%     
==========================================
  Files          14       14              
  Lines        3921     3518     -403     
==========================================
- Hits         3073     2720     -353     
+ Misses        848      798      -50     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ephraimfeldblum ephraimfeldblum changed the title MOD-7264: Fix JSONPath filter with recursive descent processing elements twice Refactoring Aug 26, 2024
@MeirShpilraien
Copy link

@ephraimfeldblum as we discussed. Please try to think how we can split this work to multiple smaller PR's which is easier to review. Make sure to have a detailed message that explain the changes. If there are some API changes, make sure to specify them and explain why it was done.

Last, make sure to split bugs to separate PR's so it will be easier to cherrypick (if needed).

@ephraimfeldblum
Copy link
Collaborator Author

ephraimfeldblum commented Aug 27, 2024

Please try to think how we can split this work to multiple smaller PR's which is easier to review.

Sure thing.

Make sure to have a detailed message that explain the changes. If there are some API changes, make sure to specify them and explain why it was done.

Almost none to external APIs. iirc, just regarding ownership to prevent having to clone unnecessarily.

Last, make sure to split bugs to separate PR's so it will be easier to cherrypick (if needed).

Yep. Already removed from here.

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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy