fix: trim whitespace in search filters to prevent API 400 errors#6934
fix: trim whitespace in search filters to prevent API 400 errors#6934talissoncosta wants to merge 2 commits intorefactor/feature-fetchingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Docker builds report
|
Typing only spaces in the value search filter sent whitespace to the API, which returned a 400 "This field may not be blank." error. Trim the value before sending in both the RTK Query and Flux store paths. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
b7f106c to
4e34ff7
Compare
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
|
Extract a single normaliseFilters function to trim search and value_search fields, preventing whitespace-only API requests. Add unit tests covering trim, null, and empty string edge cases. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
bf43459 to
c81cea0
Compare
docs/if required so people know about the feature.Changes
Contributes to #6930
Typing only whitespace (e.g. a space) in the feature search or value search fields sent
search=%20to the API, which returned a 400"This field may not be blank."error.featureFilterParams.ts: AddnormaliseFilters— a centralised function that trimssearchandvalue_searchfields, converting whitespace-only values tonulluseFeatureFilters.ts: UsenormaliseFiltersinhandleFilterChangewithisEqual(lodash) to skip state updates when the effective filter hasn't changed — preventing unnecessary API requestsfeatureFilterParams.test.ts: Add unit tests fornormaliseFilterscovering trim, null, and empty string edge casesHow did you test this code?
npm run test:unit -- --testPathPatterns=featureFilterParams(32 tests pass)