From 05cb9f49d4babfdb4eb0477d4758f92e85583e87 Mon Sep 17 00:00:00 2001 From: Andrew Cholakian Date: Mon, 8 Jun 2020 18:34:44 -0500 Subject: [PATCH] Incorporate PR feedback --- .../server/lib/requests/search/refine_potential_matches.ts | 5 ++++- .../apis/uptime/rest/monitor_states_generated.ts | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/uptime/server/lib/requests/search/refine_potential_matches.ts b/x-pack/plugins/uptime/server/lib/requests/search/refine_potential_matches.ts index fbcd0dd488b5b..2f54f3f6dd689 100644 --- a/x-pack/plugins/uptime/server/lib/requests/search/refine_potential_matches.ts +++ b/x-pack/plugins/uptime/server/lib/requests/search/refine_potential_matches.ts @@ -62,7 +62,10 @@ export const fullyMatchingIds = (queryResult: any, statusFilter?: string) => { // // We just check if the timestamp is greater. Note this may match an incomplete check group // that has not yet sent a summary doc - if (latestStillMatchingSource['@timestamp'] >= latestSource['@timestamp']) { + if ( + latestStillMatchingSource && + latestStillMatchingSource['@timestamp'] >= latestSource['@timestamp'] + ) { matched = true; } const checkGroup = latestSource.monitor.check_group; diff --git a/x-pack/test/api_integration/apis/uptime/rest/monitor_states_generated.ts b/x-pack/test/api_integration/apis/uptime/rest/monitor_states_generated.ts index 73b6111000c5d..34cf15e061569 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/monitor_states_generated.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/monitor_states_generated.ts @@ -71,7 +71,6 @@ export default function ({ getService }: FtrProviderContext) { const url = getBaseUrl(dateRangeStart, dateRangeEnd) + `&filters=${filters}`; const apiResponse = await supertest.get(url); const nonSummaryRes = apiResponse.body; - // expect(JSON.stringify(nonSummaryRes)).to.eql("foo"); expect(nonSummaryRes.summaries.length).to.eql(1); });