Skip to content

MOD-4107 Limit json doc depth to 128#1487

Merged
AvivDavid23 merged 9 commits intomasterfrom
MOD-4107
Jan 21, 2026
Merged

MOD-4107 Limit json doc depth to 128#1487
AvivDavid23 merged 9 commits intomasterfrom
MOD-4107

Conversation

@AvivDavid23
Copy link
Copy Markdown
Contributor

@AvivDavid23 AvivDavid23 commented Jan 20, 2026

Note

Imposes a strict depth cap to prevent excessively nested JSON values.

  • Introduces MAX_DEPTH=128 and SelectValue::calculate_value_depth(); tracks traversal depth in follow_path
  • Propagates depth to mutators and enforces limits in set_value, dict_add, arr_append, arr_insert, and merge via can_merge() with err_recursion_limit_exceeded
  • Publicizes error helpers and uses bounded parsing for RDB load (from_str(..., limit_depth=true))
  • Adjusts APIs to pass depth (closures now receive usize depth)
  • Updates tests: remove unbounded-depth cases; add coverage for depth limits in JSON.SET/MSET, array ops, and JSON.MERGE

Written by Cursor Bugbot for commit 77954da. This will update automatically on new commits. Configure here.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 20, 2026

Codecov Report

❌ Patch coverage is 95.83333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.82%. Comparing base (de7a14e) to head (77954da).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
redis_json/src/ivalue_manager.rs 94.52% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1487      +/-   ##
==========================================
+ Coverage   77.55%   77.82%   +0.27%     
==========================================
  Files          15       15              
  Lines        3832     3897      +65     
==========================================
+ Hits         2972     3033      +61     
- Misses        860      864       +4     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

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 2 potential issues.

Comment thread redis_json/src/ivalue_manager.rs
Comment thread redis_json/src/ivalue_manager.rs
@AvivDavid23 AvivDavid23 merged commit 50f3765 into master Jan 21, 2026
22 checks passed
@AvivDavid23 AvivDavid23 deleted the MOD-4107 branch January 21, 2026 07:56
fn get_long(&self) -> i64;
fn get_double(&self) -> f64;

fn calculate_value_depth(&self) -> usize {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

mybe this is too costy in terms of prefomence

AvivDavid23 added a commit that referenced this pull request Jan 27, 2026
AvivDavid23 added a commit that referenced this pull request Feb 24, 2026
* MOD-4107 Limit json doc depth to 128
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.

3 participants