mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Ensure task expiration has precedence over any other state
This commit is contained in:
@@ -191,9 +191,10 @@ describe("PersistentTaskProgressMonitorAlert.vue", () => {
|
||||
expect(completedAlert.text()).not.toContain("Download here");
|
||||
});
|
||||
|
||||
it("should render a warning alert when the task has expired", () => {
|
||||
it("should render a warning alert when the task has expired even if the status is running", () => {
|
||||
const useMonitor = {
|
||||
...FAKE_MONITOR,
|
||||
isRunning: ref(true),
|
||||
};
|
||||
const existingMonitoringData: MonitoringData = {
|
||||
taskId: "1",
|
||||
|
||||
@@ -107,13 +107,13 @@ function dismissAlert() {
|
||||
|
||||
<template>
|
||||
<div v-if="hasMonitoringData" class="d-flex justify-content-end">
|
||||
<BAlert v-if="isRunning" variant="info" show>
|
||||
<BAlert v-if="hasExpired" variant="warning" show dismissible @dismissed="dismissAlert">
|
||||
The {{ monitorRequest.action }} task has <b>expired</b> and the result is no longer available.
|
||||
</BAlert>
|
||||
<BAlert v-else-if="isRunning" variant="info" show>
|
||||
<b>{{ inProgressMessage }}</b>
|
||||
<FontAwesomeIcon :icon="faSpinner" class="mr-2" spin />
|
||||
</BAlert>
|
||||
<BAlert v-else-if="hasExpired" variant="warning" show dismissible @dismissed="dismissAlert">
|
||||
The {{ monitorRequest.action }} task has <b>expired</b> and the result is no longer available.
|
||||
</BAlert>
|
||||
<BAlert v-else-if="isCompleted" variant="success" show dismissible @dismissed="dismissAlert">
|
||||
<span>{{ completedMessage }}</span>
|
||||
<BLink v-if="downloadUrl" class="download-link" :href="downloadUrl">
|
||||
|
||||
@@ -179,6 +179,12 @@ export function usePersistentProgressTaskMonitor(
|
||||
return loadStatus(currentMonitoringData.value.status!);
|
||||
}
|
||||
|
||||
if (hasExpired.value) {
|
||||
// The monitoring data has expired. Requesting the status again will likely
|
||||
// return incorrect results. Reset the monitoring data to start fresh.
|
||||
return;
|
||||
}
|
||||
|
||||
return waitForTask(currentMonitoringData.value.taskId);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user