Open
Conversation
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
| } | ||
|
|
||
| return startIndex; | ||
| } |
There was a problem hiding this comment.
Duplicated GetDocumentIndex risks inconsistent future fixes
Low Severity
GetDocumentIndex is defined identically as private static in both SearchResponse and SearchResponse<T> within the same file. If a bug is later found in this heuristic (e.g., handling a new metadata format), only one copy might get patched. Since both classes live in the same file, this could be a single internal static method on one class referenced by the other, or extracted to a small shared helper.
Additional Locations (1)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Issue #310
Search response parsing assumed FT.SEARCH replies were always id plus field payload pairs. WITHSCORES inserts a scalar score after each document id, which broke parsing and could trigger duplicate-key failures.
Fix:
Tests:
Risk:
Note
Medium Risk
Adjusts core FT.SEARCH reply parsing to skip scalar metadata entries (e.g., scores), which can affect how documents are materialized across typed and primitive search responses if the index-walking logic is wrong.
Overview
Fixes FT.SEARCH response parsing when
WITHSCORESis used by skipping scalar metadata entries between a document id and its field payload, instead of assuming strictid, payloadpairs.Applies the same index-scanning logic to
SearchResponse,SearchResponse<T>(typed hash mapping), and primitive responses, and adds regression tests covering both duplicate and distinct scores to ensure document ids and fields are parsed correctly.Written by Cursor Bugbot for commit cd9aabf. This will update automatically on new commits. Configure here.