Fix crash on empty batch response in multi-entry queries#111
Conversation
Co-authored-by: atimin <67068+atimin@users.noreply.github.com> Co-authored-by: atimin <67068+atimin@users.noreply.github.com>
Co-authored-by: atimin <67068+atimin@users.noreply.github.com>
atimin
left a comment
There was a problem hiding this comment.
Update other tests what crashed in the CI/CD. Don't test messages only statuses. Update changeloge using the ID of the current PR.
tests/reduct/entry_api_test.cc
Outdated
| REQUIRE(received == std::map<std::string, std::string>{{"entry-a", "aaa"}, {"entry-b", "bbb"}}); | ||
| } | ||
|
|
||
| TEST_CASE("reduct::IBucket should handle empty batch for multi-entry query", "[entry_api][1_18]") { |
There was a problem hiding this comment.
test the function directly without the server, since it happens when a query timeouted.
There was a problem hiding this comment.
Changed to test ParseAndBuildBatchedRecordsV2 directly with empty entries header. The unit test simulates an empty batch response without requiring a server. (e80f117)
- Test ParseAndBuildBatchedRecordsV2 directly without server - Remove error message checks, only check status codes - Update CHANGELOG with PR-110 reference Co-authored-by: atimin <67068+atimin@users.noreply.github.com> Co-authored-by: atimin <67068+atimin@users.noreply.github.com>
Updated tests to check only status codes, not error messages. Updated CHANGELOG with PR-110 reference. (e80f117) |
|
@copilot There are more tests broken because of error messages. Check only statuses. |
- Update bucket_api_test.cc: 6 message checks removed - Update entry_api_test.cc: 8 message checks removed - Update server_api_test.cc: 2 message checks removed - Fix error code for extension test (422 not 400) Co-authored-by: atimin <67068+atimin@users.noreply.github.com> Co-authored-by: atimin <67068+atimin@users.noreply.github.com>
Summary
Fixed SDK crash on empty batch for multi-entry querying by filtering empty strings in
ParseEncodedListfunction. Replaced integration test with unit test that directly tests the parsing function. Removed all error message checks from tests (16 total), now only verifying status codes to avoid CI/CD failures when error messages change.Security Summary
No security vulnerabilities were discovered or introduced by these changes.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.