Open dgieselaar opened 1 year ago
Pinging @elastic/apm-ui (Team:APM)
If known, can you link to the test that is causing this?
@sqren Updated the issue description.
- use
nonEmptyStringRt
instead oft.string
forfieldName
in the route validation if we decide the request should be invalid
I agree that would be better but it looks like it wouldn't affect anything we do today. fieldName
is already required in the two components calling that endpoint afaict:
Which begs the question: how does this then happen?
@sqren TypeScript is not very helpful when dealing with empty strings (vs non-empty strings). nonEmptyStringRt
would at least add a more strict API validation.
Ahh, you are right. Required doesn't mean non-empty.
I think the error is caused by the initial state that has an empty key: ''
:
We can fix this by only making the request when fieldName
is non-empty:
https://github.com/elastic/kibana/blob/3f64d246607c8bf5fa14193cf6852874af860ee2/x-pack/plugins/apm/public/components/shared/suggestions_select/index.tsx#L53-L69
@gbamparop Still annoying, should be an easy fix, can we pull it in for 8.10?
@gbamparop Still annoying, should be an easy fix, can we pull it in for 8.10?
What about including it in the next test plan?
The
GET /internal/apm/suggestions
endpoint is being called in the E2E tests withfieldName
being an empty string, resulting in an error from ES, because the term query that is used ends up being invalid due to it missing a field name.This results in a lot of noise in the E2E test log. We should:
nonEmptyStringRt
instead oft.string
forfieldName
in the route validation if we decide the request should be invalidAt least one E2E test that is exhibiting this issue is power_user/settings/custom_links.cy.ts. See https://buildkite.com/elastic/kibana-pull-request/builds/82001#01840561-a6ab-4c53-86bb-c560ccc618a6 for an example.