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

Index Pattern Loading #1601

Closed
wants to merge 7 commits into from
Closed

Conversation

spalger
Copy link
Contributor

@spalger spalger commented Oct 8, 2014

Fixes #1561
Fixes a bug introduced by aca2457.

The code in aca2457 assumes that SearchSources would have an indexPattern defined on them. This is the case with savedSearches but not for visualizations. Rather than use the indexPattern saving build into the SavedObject, they manage a separate indexPattern property, and link it to the SearchSource in the SavedObject#afterEsResp() callback.

This fixes the bug with the following updates:

  • SavedVis no longer manages it's own indexPattern, it is managed by the underlying SavedObject
  • searchSource.get('index') will always work synchronously
    • Previously, if a searchSource inherited it's index pattern from the global searchSource, it would return undefined.
  • rootSearchSource does not update it's index pattern when the config is changed
    • it now happens in routeSetup, which is what allowed us to make the calls to DataSource#getParent() and DataSource#get() behave synchronously.

@spalger spalger changed the title Index pattern/loading Index Pattern Loading Oct 8, 2014
@rashidkpc rashidkpc added this to the 4.0.0-BETA2 milestone Oct 8, 2014
@rashidkpc rashidkpc self-assigned this Oct 8, 2014
@rashidkpc
Copy link
Contributor

Were you able to reliably replicate #1561?

@spalger
Copy link
Contributor Author

spalger commented Oct 9, 2014

Not "reliably", but every time I got it to happen the same scenario was true: the index pattern didn't have an id, which prevented it from getting fields.

After looking at all of the places where index patterns are created I narrowed this out as the culprit.

@rashidkpc
Copy link
Contributor

This LGTM but I'd like a 2nd set of eyes on it.

@w33ble w33ble mentioned this pull request Oct 9, 2014
@w33ble
Copy link
Contributor

w33ble commented Oct 9, 2014

Replaced by #1617

@w33ble w33ble closed this Oct 9, 2014
@spalger spalger deleted the indexPattern/loading branch December 12, 2014 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fatal Error Cannot read property 'byName' of undefined
3 participants