Skip to content

Commit

Permalink
[discover] wait for dataset to created (#8117)
Browse files Browse the repository at this point in the history
Cache dataset is an async function that ends up creating the temporary index pattern. The temporary index pattern was not created and was causing an exception so the index pattern was never updated.

The index pattern not being updated didn't trigger the hooks to update the other parts of the app.

Signed-off-by: Kawika Avilla <[email protected]>
  • Loading branch information
kavilla authored Sep 10, 2024
1 parent fbac07b commit 8ecba3a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/plugins/data/public/ui/dataset_selector/configurator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ export const Configurator = ({
/>
</EuiButton>
<EuiButton
onClick={() => {
queryString.getDatasetService().cacheDataset(dataset);
onClick={async () => {
await queryString.getDatasetService().cacheDataset(dataset);
onConfirm(dataset);
}}
fill
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { cloneDeep } from 'lodash';
import { useLocation } from 'react-router-dom';
import { RequestAdapter } from '../../../../../inspector/public';
import { DiscoverViewServices } from '../../../build_services';
import { QueryStatus, search } from '../../../../../data/public';
import { search } from '../../../../../data/public';
import { validateTimeRange } from '../../helpers/validate_time_range';
import { updateSearchSource } from './update_search_source';
import { useIndexPattern } from './use_index_pattern';
Expand Down

0 comments on commit 8ecba3a

Please sign in to comment.