Update all useKeyedCache fetch handlers to preserve HTTP status codes

Switches the 12 cache-backed fetch handlers across 6 store/api files
from rethrowSimple to rethrowSimpleWithStatus so that the keyedCache
retry logic can distinguish retryable server errors from permanent
client errors. The cancelWorkflowScheduling handler (a DELETE, not a
cache handler) keeps using rethrowSimple.
This commit is contained in:
Dannon Baker
2026-02-24 13:02:30 -05:00
parent 7f8dcd75bb
commit f7e404b4e9
6 changed files with 27 additions and 27 deletions
+2 -2
View File
@@ -55,7 +55,7 @@ export async function loadDatasets(options: LoadDatasetsOptions): Promise<LoadDa
}
export async function fetchDatasetTextContentDetails(params: { id: string }): Promise<DatasetTextContentDetails> {
const { data, error } = await GalaxyApi().GET("/api/datasets/{dataset_id}/get_content_as_text", {
const { data, error, response } = await GalaxyApi().GET("/api/datasets/{dataset_id}/get_content_as_text", {
params: {
path: {
dataset_id: params.id,
@@ -64,7 +64,7 @@ export async function fetchDatasetTextContentDetails(params: { id: string }): Pr
});
if (error) {
rethrowSimple(error);
rethrowSimpleWithStatus(error, response);
}
return data;
}
@@ -2,15 +2,15 @@ import { defineStore } from "pinia";
import { type DatasetCollectionAttributes, GalaxyApi } from "@/api";
import { type FetchParams, useKeyedCache } from "@/composables/keyedCache";
import { rethrowSimple } from "@/utils/simple-error";
import { rethrowSimpleWithStatus } from "@/utils/simple-error";
export const useCollectionAttributesStore = defineStore("collectionAttributesStore", () => {
async function fetchAttributes(params: FetchParams): Promise<DatasetCollectionAttributes> {
const { data, error } = await GalaxyApi().GET("/api/dataset_collections/{hdca_id}/attributes", {
const { data, error, response } = await GalaxyApi().GET("/api/dataset_collections/{hdca_id}/attributes", {
params: { path: { hdca_id: params.id } },
});
if (error) {
rethrowSimple(error);
rethrowSimpleWithStatus(error, response);
}
return data;
}
+3 -3
View File
@@ -3,15 +3,15 @@ import { defineStore } from "pinia";
import { GalaxyApi } from "@/api";
import type { DatasetExtraFiles } from "@/api/datasets";
import { type FetchParams, useKeyedCache } from "@/composables/keyedCache";
import { rethrowSimple } from "@/utils/simple-error";
import { rethrowSimpleWithStatus } from "@/utils/simple-error";
export const useDatasetExtraFilesStore = defineStore("datasetExtraFilesStore", () => {
async function fetchDatasetExtraFiles(params: FetchParams): Promise<DatasetExtraFiles> {
const { data, error } = await GalaxyApi().GET("/api/datasets/{dataset_id}/extra_files", {
const { data, error, response } = await GalaxyApi().GET("/api/datasets/{dataset_id}/extra_files", {
params: { path: { dataset_id: params.id } },
});
if (error) {
rethrowSimple(error);
rethrowSimpleWithStatus(error, response);
}
return data;
}
+13 -13
View File
@@ -10,53 +10,53 @@ import type {
WorkflowInvocationRequest,
} from "@/api/invocations";
import { type FetchParams, useKeyedCache } from "@/composables/keyedCache";
import { rethrowSimple } from "@/utils/simple-error";
import { rethrowSimple, rethrowSimpleWithStatus } from "@/utils/simple-error";
export const useInvocationStore = defineStore("invocationStore", () => {
const scrollListScrollTop = ref(0);
async function fetchInvocationDetails(params: FetchParams): Promise<WorkflowInvocation> {
const { data, error } = await GalaxyApi().GET("/api/invocations/{invocation_id}", {
const { data, error, response } = await GalaxyApi().GET("/api/invocations/{invocation_id}", {
params: { path: { invocation_id: params.id } },
});
if (error) {
rethrowSimple(error);
rethrowSimpleWithStatus(error, response);
}
return data;
}
async function fetchInvocationJobsSummary(params: FetchParams): Promise<InvocationJobsSummary> {
const { data, error } = await GalaxyApi().GET("/api/invocations/{invocation_id}/jobs_summary", {
const { data, error, response } = await GalaxyApi().GET("/api/invocations/{invocation_id}/jobs_summary", {
params: { path: { invocation_id: params.id } },
});
if (error) {
rethrowSimple(error);
rethrowSimpleWithStatus(error, response);
}
return data;
}
async function fetchInvocationStepJobsSummary(params: FetchParams): Promise<StepJobSummary[]> {
const { data, error } = await GalaxyApi().GET("/api/invocations/{invocation_id}/step_jobs_summary", {
const { data, error, response } = await GalaxyApi().GET("/api/invocations/{invocation_id}/step_jobs_summary", {
params: { path: { invocation_id: params.id } },
});
if (error) {
rethrowSimple(error);
rethrowSimpleWithStatus(error, response);
}
return data;
}
async function fetchInvocationStep(params: FetchParams): Promise<InvocationStep> {
const { data, error } = await GalaxyApi().GET("/api/invocations/steps/{step_id}", {
const { data, error, response } = await GalaxyApi().GET("/api/invocations/steps/{step_id}", {
params: { path: { step_id: params.id } },
});
if (error) {
rethrowSimple(error);
rethrowSimpleWithStatus(error, response);
}
return data;
}
async function fetchInvocationRequest(params: FetchParams): Promise<WorkflowInvocationRequest> {
const { data, error } = await GalaxyApi().GET("/api/invocations/{invocation_id}/request", {
const { data, error, response } = await GalaxyApi().GET("/api/invocations/{invocation_id}/request", {
params: {
path: {
invocation_id: params.id,
@@ -64,17 +64,17 @@ export const useInvocationStore = defineStore("invocationStore", () => {
},
});
if (error) {
rethrowSimple(error);
rethrowSimpleWithStatus(error, response);
}
return data;
}
async function fetchInvocationCount(params: FetchParams): Promise<number> {
const { data, error } = await GalaxyApi().GET("/api/workflows/{workflow_id}/counts", {
const { data, error, response } = await GalaxyApi().GET("/api/workflows/{workflow_id}/counts", {
params: { path: { workflow_id: params.id } },
});
if (error) {
rethrowSimple(error);
rethrowSimpleWithStatus(error, response);
}
let allCounts = 0;
@@ -3,17 +3,17 @@ import { defineStore } from "pinia";
import { GalaxyApi } from "@/api";
import type { JobDestinationParams } from "@/api/jobs";
import { type FetchParams, useKeyedCache } from "@/composables/keyedCache";
import { rethrowSimple } from "@/utils/simple-error";
import { rethrowSimpleWithStatus } from "@/utils/simple-error";
export const useJobDestinationParametersStore = defineStore("jobDestinationParametersStore", () => {
async function fetchJobDestinationParams(params: FetchParams): Promise<JobDestinationParams> {
const { data, error } = await GalaxyApi().GET("/api/jobs/{job_id}/destination_params", {
const { data, error, response } = await GalaxyApi().GET("/api/jobs/{job_id}/destination_params", {
params: {
path: { job_id: params.id },
},
});
if (error) {
rethrowSimple(error);
rethrowSimpleWithStatus(error, response);
}
return data;
}
+3 -3
View File
@@ -9,18 +9,18 @@ import { ref } from "vue";
import { GalaxyApi } from "@/api";
import { type ResponseVal, type ShowFullJobResponse, TERMINAL_STATES } from "@/api/jobs";
import { type FetchParams, useKeyedCache } from "@/composables/keyedCache";
import { rethrowSimple } from "@/utils/simple-error";
import { rethrowSimpleWithStatus } from "@/utils/simple-error";
export const useJobStore = defineStore("jobStore", () => {
const latestResponse = ref<ResponseVal | null>(null);
async function fetchJobById(params: FetchParams): Promise<ShowFullJobResponse> {
const { data, error } = await GalaxyApi().GET("/api/jobs/{job_id}", {
const { data, error, response } = await GalaxyApi().GET("/api/jobs/{job_id}", {
params: { path: { job_id: params.id } },
query: { full: true },
});
if (error) {
rethrowSimple(error);
rethrowSimpleWithStatus(error, response);
}
return data;
}