Skip to content

Commit

Permalink
Handle empty datafeedState (elastic#48660)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alejandro Fernández committed Oct 21, 2019
1 parent 7f74d61 commit 75e754b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export type FetchJobStatusRequestPayload = rt.TypeOf<typeof fetchJobStatusReques
const datafeedStateRT = rt.keyof({
started: null,
stopped: null,
'': null,
});

const jobStateRT = rt.keyof({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ const getJobStatus = (jobId: string) => (jobSummaries: FetchJobStatusResponsePay
.filter(jobSummary => jobSummary.id === jobId)
.map(
(jobSummary): JobStatus => {
if (jobSummary.jobState === 'failed') {
if (jobSummary.jobState === 'failed' || jobSummary.datafeedState === '') {
return 'failed';
} else if (
jobSummary.jobState === 'closed' &&
Expand Down

0 comments on commit 75e754b

Please sign in to comment.