-
Notifications
You must be signed in to change notification settings - Fork 5
handlers: fix panic in search, fix #300 #301
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a panic in the search functionality by removing redundant deduplication logic for requested attributes.
- Removed code that created a deduplicated attribute list (searchHeader)
- Updated calls and loops to use searchFilters.Attributes directly
Comments suppressed due to low confidence (1)
handlers/objects.go:477
- The removal of the deduplication code (using searchHeader) appears intentional per the commit message; please confirm that passing searchFilters.Attributes directly meets the API's requirements for attribute ordering and uniqueness.
searchHeader = filters[0].Header()
What is wrong with the tests? |
This logic adds an implicit first attribute if it's missing from the original request. It assumes that there is always at least one filter present which is no longer true after 706d7d4. Now the code is adjusted for that. Signed-off-by: Roman Khimov <roman@nspcc.ru>
ca083ec
to
283de8f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a panic in the search functionality by revising how attributes are processed and ensuring proper initialization. Key changes include:
- Initializing returningAttributes with additional capacity.
- Declaring and assigning searchHeader only when filters are available.
- Adjusting how attributes are appended to returningAttributes.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #301 +/- ##
=========================================
- Coverage 9.01% 9.00% -0.01%
=========================================
Files 22 22
Lines 5593 5597 +4
=========================================
Hits 504 504
- Misses 5054 5058 +4
Partials 35 35 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
706d7d4 made this logic (that tried to deduplicate requested attributes) completely irrelevant.