Skip to content
Merged
8 changes: 6 additions & 2 deletions src/plugins/es_ui_shared/public/request/np_ready_request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ export const useRequest = (

const response = await sendRequest(httpClient, requestBody);
const { data: serializedResponseData, error: responseError } = response;
const responseData = deserializer(serializedResponseData);

// If an outdated request has resolved, DON'T update state, but DO allow the processData handler
// to execute side effects like update telemetry.
Expand All @@ -129,7 +128,12 @@ export const useRequest = (
}

setError(responseError);
setData(responseData);

if (!responseError) {
const responseData = deserializer(serializedResponseData);
setData(responseData);
}

setIsLoading(false);
setIsInitialRequest(false);

Expand Down
5 changes: 1 addition & 4 deletions x-pack/plugins/watcher/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class WatcherUIPlugin implements Plugin<void, void, Dependencies, any> {
}),
icon: 'watchesApp',
path: '/app/kibana#/management/elasticsearch/watcher/watches',
showOnHomePage: true,
showOnHomePage: false,
};

home.featureCatalogue.register(watcherHome);
Expand All @@ -85,9 +85,6 @@ export class WatcherUIPlugin implements Plugin<void, void, Dependencies, any> {
if (valid) {
watcherESApp.enable();
watcherHome.showOnHomePage = true;
} else {
watcherESApp.disable();
watcherHome.showOnHomePage = false;
}
});
}
Expand Down
2 changes: 2 additions & 0 deletions x-pack/test/functional/apps/watcher/watcher_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export default function({ getService, getPageObjects }) {
await browser.setWindowSize(1600, 1000);
// TODO: Remove the retry.try wrapper once https://github.com/elastic/kibana/issues/55985 is resolved
retry.try(async () => {
// Try to give the license time to come through.
await PageObjects.common.sleep(2000);
Copy link
Contributor

@cuff-links cuff-links Jan 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to remove this hard coded sleep. It's been my experience that this sometimes fails in CI. We might want to try using the retry.waitFor() function and figure out a reasonable condition to wait for. We can wait for anything that can return true of false so if we need to wait for a license to be changed or something, we can hit the license API using the ES client. What do you think about that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @cuff-links , that sounds reasonable :)

await PageObjects.common.navigateToApp('watcher');
await testSubjects.find('createWatchButton');
});
Expand Down