-
[OPIK-7397] [BE] fix: ignore null/blank sort field instead of 500 (SortingFactory NPE) (#7534)
发布于
2026-07-21 07:37:14 +00:00 - [OPIK-7397] [BE] fix: ignore null/blank sort field instead of 500
GET /v1/private/traces 500s with NullPointerException when a sorting entry has a
null field: SortingFactory.isFieldSupported does getSortableFields().contains(field)
and the immutable List throws on contains(null). Treat a null/blank field as
unsupported in filterValidFields so it is ignored (the documented graceful
degradation) rather than dereferenced. Adds unit tests for null, blank, unsupported
and supported fields.Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
- [OPIK-7397] [BE] fix: drop null/blank sort field before processFields
The earlier guard in filterValidFields ran after processFields, so a null field
still reached SortingFactoryDatasets.ensureBindKeyParam (field.startsWith) and NPE'd
on the datasets endpoints. Drop null/blank-field entries at the top of newSorting,
before any per-field processing, so every subclass hook is protected; revert the
now-redundant guard in filterValidFields. Adds tests for the datasets factory path
and a mixed valid+null case.Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
Co-authored-by: Claude Opus 4.8 (1M context) noreply@anthropic.com
下载附件