Skip to content

Cherry-pick: Cherry-pick bug fixes to 8.8 (#1557) - #1580

Merged
AvivDavid23 merged 6 commits into
2.4from
cherry-pick-0b3cc6ea-to-2.4
Apr 26, 2026
Merged

AvivDavid23 merged 6 commits into
2.4from
cherry-pick-0b3cc6ea-to-2.4

Conversation

@AvivDavid23

@AvivDavid23 AvivDavid23 commented Apr 26, 2026 •

Copy link
Copy Markdown
Contributor

Cherry-pick of 0b3cc6e onto 2.4

Includes:

  • MOD-6722 Fix mutation ordering for array commands with recursive paths
  • MOD-7266 make sure to end() deserialization, to disallow trailing content
  • MOD-14664 Json Path evaluation - Allow multi-result nodelists in filter comparisons, Don't evaluate filters on scalar types

Conflict resolutions (2.4 has significantly diverged structure):

  • src/jsonpath/json_path.rs (old path — 2.4 predates the json_path/ crate extraction):
    • Added Null and NodeList variants to TermEvaluationResult enum
    • Added ord_cmp_matches helper + refactored ge/lt/le to use it (adapted NotComparable → NotCmparable for 2.4's existing typo in CmpResult)
    • Added results_to_term helper + updated call sites
    • Removed filter-on-scalar else if branch (RFC 9535)
  • src/jsonpath/mod.rs: added test_filter_null test
  • src/ivalue_manager.rs (old path): applied MOD-7266 deserializer.end() fix here (instead of redis_json/src/ivalue_manager.rs which doesn't exist in 2.4)
  • redis_json/src/commands.rs: auto-merged cleanly (MOD-6722 applied without conflicts)
  • tests/pytest/test.py: kept 2.4-specific RDB test content; added test_json_set_rejects_trailing_characters (MOD-7266) and test_recursive_descent; skipped test_mset_replication_in_aof (JSON.MSET not in 2.4)

Made with Cursor


Note

Medium Risk
Touches JSON mutation and JSONPath filter evaluation semantics, so behavior can change for existing queries and recursive array updates; also tightens JSON.SET parsing to reject previously-accepted trailing characters.

Overview
Fixes in-place mutation ordering for array-mutating commands (JSON.ARRPOP, JSON.ARRTRIM, JSON.ARRINSERT) when a query matches nested arrays (e.g. $..*) by sorting matched paths deepest-first / highest-index-first while still returning replies in original match order.

Tightens JSON input parsing by requiring serde_json::Deserializer::end() after deserialization (in both IValue and serde_json::Value managers), so JSON.SET and related parsing now rejects valid JSON followed by trailing characters.

Updates JSONPath filter evaluation to support multi-result subqueries in comparisons via a NodeList (match succeeds if any element matches), and stops applying filter selectors to primitive values per RFC 9535; adds/updates Python + Rust tests to cover these cases and to ensure recursive-descent filters don’t duplicate scalar results.

Reviewed by Cursor Bugbot for commit b79bc89. Bugbot is set up for automated code reviews on this repo. Configure here.

AvivDavid23 and others added 3 commits April 26, 2026 08:52
* MOD-6722 Fix mutation ordering for array commands with recursive paths (#1543)

* MOD-7266 make sure to `end()` deserialization, to disallow trailing c… (#1554)

* MOD-14664 Json Path evaluation - Allow multi-result nodelists in filt… (#1542)

* MOD-14664 Json Path evaluation - Allow multi-result nodelists in filter comparisons, Don't evaluate filters on scalar types

* MOD-7264 | MOD-7270 fmt

* tests(for coverage)

* Revert "tests(for coverage)"

This reverts commit b0668a5.
…one(), fix error type annotation

Made-with: Cursor
Made-with: Cursor
Comment thread src/jsonpath/mod.rs Resolved
…mmar

The 2.4 jsonpath grammar predates null literal support in filter expressions,
causing QueryCompilationError for "$[?(@==null)]".

Made-with: Cursor

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 51abb4f. Configure here.

Comment thread src/jsonpath/json_path.rs Resolved
…ashing tests

- Apply compare_paths_for_mutation to src/commands.rs (arr_insert/pop/trim
  impl and legacy functions) — the mutation ordering fix was never ported
  to 2.4's src/commands.rs during the initial cherry-pick
- Force rebuild exposed stale binary for MOD-7266 (deserializer.end());
  the fix was already in src/ivalue_manager.rs but the old .dylib predated it
- Add test for trailing-char rejection in ivalue_manager unit tests
- Remove test_recursive_descent: JSON.SET with $..* wildcard crashes 2.4's
  server (pre-existing bug unrelated to this cherry-pick)

Made-with: Cursor
@AvivDavid23
AvivDavid23 merged commit 67bdfec into 2.4 Apr 26, 2026
56 of 57 checks passed
@AvivDavid23
AvivDavid23 deleted the cherry-pick-0b3cc6ea-to-2.4 branch April 26, 2026 11:18
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