Always add status to image download report

It seems that in some cases the supervisor can report
an image without a `status` field leading to a cloud side 401 response.
See #1905 for more details.

Change-type: patch
This commit is contained in:
Felipe Lalanne 2022-03-21 14:39:29 -03:00
parent 37a82e2dd6
commit 21c1c006f7

View File

@ -193,7 +193,11 @@ export async function triggerFetch(
}
const onProgress = (progress: FetchProgressEvent) => {
reportEvent('update', { ...image, downloadProgress: progress.percentage });
reportEvent('update', {
...image,
downloadProgress: progress.percentage,
status: 'Downloading',
});
};
let success: boolean;
@ -261,7 +265,7 @@ export async function triggerFetch(
}
}
reportEvent('finish', image);
reportEvent('finish', { ...image, status: 'Downloaded' });
onFinish(success);
}