Skip to content
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

Fieldlist in Discover can break on unknown fields #75025

Closed
timroes opened this issue Aug 14, 2020 · 3 comments
Closed

Fieldlist in Discover can break on unknown fields #75025

timroes opened this issue Aug 14, 2020 · 3 comments
Labels
blocker bug Fixes for quality problems that affect the customer experience Feature:Discover Discover Application regression Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.10.0

Comments

@timroes
Copy link
Contributor

timroes commented Aug 14, 2020

Branch: master / 7.x (?)

I ran into scenarios (where I simply installed sample data, as far as I can recall), where unknown fields in the discover field list can cause it to break:

screenshot-20200814-095712

The products field on the very bottom (a) does not have a label anymore and (b) when clicking it the whole field list vanishes, since it throws the following JS error:

field_calculator.js:24 Uncaught TypeError: Cannot read property 'flattenHit' of undefined
    at getFieldValues (field_calculator.js:24)
    at Object.getFieldValueCounts (field_calculator.js:44)
    at getDetails (get_details.ts:25)
    at discover_sidebar.tsx:71
    at DiscoverField (discover_field.tsx:112)
    at renderWithHooks (react-dom.development.js:16260)
    at updateFunctionComponent (react-dom.development.js:18347)
    at beginWork$1 (react-dom.development.js:20176)
    at HTMLUnknownElement.callCallback (react-dom.development.js:336)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:385)
getFieldValues @ field_calculator.js:24
getFieldValueCounts @ field_calculator.js:44
getDetails @ get_details.ts:25
(anonymous) @ discover_sidebar.tsx:71
DiscoverField @ discover_field.tsx:112
renderWithHooks @ react-dom.development.js:16260
updateFunctionComponent @ react-dom.development.js:18347
beginWork$1 @ react-dom.development.js:20176
callCallback @ react-dom.development.js:336
invokeGuardedCallbackDev @ react-dom.development.js:385
invokeGuardedCallback @ react-dom.development.js:440
beginWork$$1 @ react-dom.development.js:25780
performUnitOfWork @ react-dom.development.js:24695
workLoopSync @ react-dom.development.js:24671
performSyncWorkOnRoot @ react-dom.development.js:24270
(anonymous) @ react-dom.development.js:12199
unstable_runWithPriority @ scheduler.development.js:697
runWithPriority$2 @ react-dom.development.js:12149
flushSyncCallbackQueueImpl @ react-dom.development.js:12194
flushSyncCallbackQueue @ react-dom.development.js:12182
discreteUpdates$1 @ react-dom.development.js:24423
discreteUpdates @ react-dom.development.js:1438
dispatchDiscreteEvent @ react-dom.development.js:5881
react_devtools_backend.js:2273 The above error occurred in the <DiscoverField> component:
    in DiscoverField (created by DiscoverSidebar)
    in li (created by DiscoverSidebar)
    in ul (created by DiscoverSidebar)
    in div (created by DiscoverSidebar)
    in section (created by DiscoverSidebar)
    in PseudoLocaleWrapper (created by I18nProvider)
    in IntlProvider (created by I18nProvider)
    in I18nProvider (created by DiscoverSidebar)
    in DiscoverSidebar

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://fb.me/react-error-boundaries to learn more about error boundaries.
overrideMethod @ react_devtools_backend.js:2273
logCapturedError @ react-dom.development.js:21843
logError @ react-dom.development.js:21880
update.callback @ react-dom.development.js:23232
callCallback @ react-dom.development.js:13829
commitUpdateEffects @ react-dom.development.js:13867
commitUpdateQueue @ react-dom.development.js:13857
commitLifeCycles @ react-dom.development.js:22160
commitLayoutEffects @ react-dom.development.js:25344
callCallback @ react-dom.development.js:336
invokeGuardedCallbackDev @ react-dom.development.js:385
invokeGuardedCallback @ react-dom.development.js:440
commitRootImpl @ react-dom.development.js:25082
unstable_runWithPriority @ scheduler.development.js:697
runWithPriority$2 @ react-dom.development.js:12149
commitRoot @ react-dom.development.js:24922
finishSyncRender @ react-dom.development.js:24329
performSyncWorkOnRoot @ react-dom.development.js:24307
(anonymous) @ react-dom.development.js:12199
unstable_runWithPriority @ scheduler.development.js:697
runWithPriority$2 @ react-dom.development.js:12149
flushSyncCallbackQueueImpl @ react-dom.development.js:12194
flushSyncCallbackQueue @ react-dom.development.js:12182
discreteUpdates$1 @ react-dom.development.js:24423
discreteUpdates @ react-dom.development.js:1438
dispatchDiscreteEvent @ react-dom.development.js:5881
react-dom.development.js:12212 Uncaught TypeError: Cannot read property 'flattenHit' of undefined
    at getFieldValues (field_calculator.js:24)
    at Object.getFieldValueCounts (field_calculator.js:44)
    at getDetails (get_details.ts:25)
    at discover_sidebar.tsx:71
    at DiscoverField (discover_field.tsx:112)
    at renderWithHooks (react-dom.development.js:16260)
    at updateFunctionComponent (react-dom.development.js:18347)
    at beginWork$1 (react-dom.development.js:20176)
    at HTMLUnknownElement.callCallback (react-dom.development.js:336)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:385)

It seems for that field the indexPattern on the field property is not defined (maybe because it's mixed in by discover?) what causes it to break.

@timroes timroes added bug Fixes for quality problems that affect the customer experience blocker Feature:Discover Discover Application regression Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.10.0 labels Aug 14, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@flash1293
Copy link
Contributor

cc @andreadelrio this is what's happening on your PR as well I think. It's probably not relevant then and we have to fix it separately anyway.

@kertal
Copy link
Member

kertal commented Aug 17, 2020

this seemed to work before the refactoring of the index pattern fields was merged #73180, dear @mattkime, could you have a look if we should fix this in Discover as the consuming app?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker bug Fixes for quality problems that affect the customer experience Feature:Discover Discover Application regression Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.10.0
Projects
None yet
Development

No branches or pull requests

5 participants