Skip to content

[8.6] Resolve PARAMS in FT.SPELLCHECK command - [MOD-10596]#9079

Merged
GuyAv46 merged 4 commits into8.6from
backport-8901-to-8.6
Apr 16, 2026
Merged

[8.6] Resolve PARAMS in FT.SPELLCHECK command - [MOD-10596]#9079
GuyAv46 merged 4 commits into8.6from
backport-8901-to-8.6

Conversation

@GuyAv46
Copy link
Copy Markdown
Collaborator

@GuyAv46 GuyAv46 commented Apr 15, 2026

Description

Backport of #8901 to 8.6.

Describe the changes in the pull request

Fix a bug where attributes/parameters in the FT.SPELLCHECK command could be left unresolved, leading to an invalid read.
Adding missing support for PARAMS in FT.SPELLCHECK.

Mark if applicable

  • This PR introduces API changes
  • This PR introduces serialization changes

Release Notes

  • This PR requires release notes
  • This PR does not require release notes

Note

Medium Risk
Touches query parsing/parameter evaluation and error propagation for FT.SPELLCHECK, which can affect request validation and failure modes across dialects; behavior is covered by new regression tests but impacts a core query path.

Overview
FT.SPELLCHECK now supports PARAMS: the command parses provided param pairs into RSSearchOptions, resolves them against the parsed query via QAST_EvalParams, and frees the param dict on exit.

QAST_EvalParams is updated to propagate errors from QueryNode_EvalParams instead of always returning success, and new pytests cover dialect 2/3 parameterized spellcheck, missing/invalid PARAMS errors, and fuzzy param substitution. .gitignore is tweaked to ignore venv directories via /*venv*/.

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

* add failing test

* resolve params on spellcheck

* properly propagate error code from QAST_EvalParams

* gitignore .venv

* small test improvement

* fix build

* improve coverage

* remove support for params, align test

* Resolve `PARAMS` in `FT.SPELLCHECK` command - [MOD-10596] (#8929)

Revert "remove support for params, align test"

(cherry picked from commit c29ae2b)
@GuyAv46 GuyAv46 requested a review from JoanFM April 15, 2026 06:43
@GuyAv46 GuyAv46 added the bug label Apr 15, 2026
@GuyAv46 GuyAv46 enabled auto-merge April 15, 2026 06:43
@jit-ci
Copy link
Copy Markdown

jit-ci Bot commented Apr 15, 2026

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

JoanFM
JoanFM previously approved these changes Apr 15, 2026
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 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 d216132. Configure here.

Comment thread src/module.c
QueryError_ClearError(&status);
if (opts.params) {
Param_DictFree(opts.params);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Params freed before QAST destroy, inconsistent cleanup order

Low Severity

Param_DictFree(opts.params) is called before QAST_Destroy(&qast), but in aggregate_request.c the established convention is the reverse: QAST_Destroy at line 1456 runs before Param_DictFree at line 1498. This matters because QueryParam_Resolve for PARAM_VEC stores a direct pointer into the dict's RedisModuleString buffer without copying. Freeing the dict first creates dangling pointers that QAST_DestroyQueryNode_Free could dereference. While spell check doesn't currently use vector params, the inconsistent ordering is a maintenance hazard.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d216132. Configure here.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.84%. Comparing base (7f8e851) to head (34f5540).
⚠️ Report is 7 commits behind head on 8.6.

Additional details and impacted files
@@            Coverage Diff             @@
##              8.6    #9079      +/-   ##
==========================================
+ Coverage   76.46%   83.84%   +7.38%     
==========================================
  Files         367      367              
  Lines       55916    55841      -75     
  Branches    14322    14322              
==========================================
+ Hits        42754    46818    +4064     
+ Misses      13000     8861    -4139     
  Partials      162      162              
Flag Coverage Δ
flow 84.84% <100.00%> (+12.38%) ⬆️
unit 50.67% <7.69%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@sonarqubecloud
Copy link
Copy Markdown

@GuyAv46 GuyAv46 added this pull request to the merge queue Apr 16, 2026
Merged via the queue into 8.6 with commit 7124b9e Apr 16, 2026
50 checks passed
@GuyAv46 GuyAv46 deleted the backport-8901-to-8.6 branch April 16, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants