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

fixes other bucket request #26874

Merged
merged 2 commits into from
Dec 12, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions src/ui/public/vis/request_handlers/courier.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const CourierRequestHandlerProvider = function () {

const queryHash = calculateObjectHash(reqBody);
// We only need to reexecute the query, if forceFetch was true or the hash of the request body has changed
// since the last request.
// since the last request
const shouldQuery = forceFetch || (searchSource.lastQuery !== queryHash);

if (shouldQuery) {
Expand All @@ -111,26 +111,26 @@ const CourierRequestHandlerProvider = function () {

searchSource.rawResponse = response;

let resp = cloneDeep(response);
for (const agg of aggs) {
if (has(agg, 'type.postFlightRequest')) {
resp = await agg.type.postFlightRequest(
resp,
aggs,
agg,
requestSearchSource,
inspectorAdapters
);
}
}

searchSource.finalResponse = resp;

requestSearchSource.getSearchRequestBody().then(req => {
request.json(req);
});
}

let resp = cloneDeep(searchSource.rawResponse);
for (const agg of aggs) {
if (has(agg, 'type.postFlightRequest')) {
resp = await agg.type.postFlightRequest(
markov00 marked this conversation as resolved.
Show resolved Hide resolved
resp,
aggs,
agg,
requestSearchSource,
inspectorAdapters
);
}
}

searchSource.finalResponse = resp;

const parsedTimeRange = timeRange ? getTime(aggs.indexPattern, timeRange) : null;
const tabifyParams = {
metricsAtAllLevels: isHierarchical,
Expand Down
4 changes: 4 additions & 0 deletions test/functional/apps/visualize/_data_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,13 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.visualize.selectAggregation('Terms');
await PageObjects.visualize.selectField('extension.raw');
await PageObjects.visualize.setSize(2);
await PageObjects.visualize.clickGo();
await PageObjects.header.waitUntilLoadingHasFinished();
ppisljar marked this conversation as resolved.
Show resolved Hide resolved

await PageObjects.visualize.toggleOtherBucket();
await PageObjects.visualize.toggleMissingBucket();
await PageObjects.visualize.clickGo();
Copy link
Member

Choose a reason for hiding this comment

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

I noticed the test is failing on CI so you may change this anyway, but it might be worth adding some sort of comment here with an explanation for the duplication or link to the relevant issue.

If I were to stumble across this test on my own, I would likely remove the duplicated lines, assuming it was a typo.

await PageObjects.header.waitUntilLoadingHasFinished();
});

it('should show correct data', async () => {
Expand Down