Skip to content

Commit 08ba53a

Browse files
committed
Fix thrown un-awaited redirect calls flagged by new lint rule
Change `throw redirectWithErrorMessage(...)` to `throw await redirectWithErrorMessage(...)` at the 9 sites flagged by the new trigger/no-thrown-unawaited-redirect oxlint rule so the redirect Response is thrown instead of a pending Promise. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EZ8nrziWFcXhqGewJgo4ei
1 parent f80e1b5 commit 08ba53a

5 files changed

Lines changed: 9 additions & 9 deletions

File tree

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.branches/route.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export async function action({ request, params }: ActionFunctionArgs) {
134134
);
135135

136136
if (!project) {
137-
throw redirectWithErrorMessage(redirectPath, request, "Project not found");
137+
throw await redirectWithErrorMessage(redirectPath, request, "Project not found");
138138
}
139139

140140
const currentPlan = await getCurrentPlan(project.organizationId);

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.concurrency/route.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export const action = async ({ request, params }: ActionFunctionArgs) => {
155155
);
156156

157157
if (!project) {
158-
throw redirectWithErrorMessage(redirectPath, request, "Project not found");
158+
throw await redirectWithErrorMessage(redirectPath, request, "Project not found");
159159
}
160160

161161
const formData = await request.formData();

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.regions/route.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,14 @@ export const action = async ({ request, params }: ActionFunctionArgs) => {
103103
);
104104

105105
if (!project) {
106-
throw redirectWithErrorMessage(redirectPath, request, "Project not found");
106+
throw await redirectWithErrorMessage(redirectPath, request, "Project not found");
107107
}
108108

109109
const formData = await request.formData();
110110
const parsedFormData = FormSchema.safeParse(Object.fromEntries(formData));
111111

112112
if (!parsedFormData.success) {
113-
throw redirectWithErrorMessage(redirectPath, request, "No region specified");
113+
throw await redirectWithErrorMessage(redirectPath, request, "No region specified");
114114
}
115115

116116
const service = new SetDefaultRegionService();

apps/webapp/app/routes/resources.orgs.$organizationSlug.select-plan.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export const action = dashboardAction(
8080
});
8181

8282
if (!organization) {
83-
throw redirectWithErrorMessage(form.callerPath, request, "Organization not found");
83+
throw await redirectWithErrorMessage(form.callerPath, request, "Organization not found");
8484
}
8585

8686
let payload: SetPlanBody;
@@ -139,7 +139,7 @@ export const action = dashboardAction(
139139
}
140140
case "paid": {
141141
if (form.planCode === undefined) {
142-
throw redirectWithErrorMessage(form.callerPath, request, "Not a valid plan");
142+
throw await redirectWithErrorMessage(form.callerPath, request, "Not a valid plan");
143143
}
144144
payload = {
145145
type: "paid" as const,

apps/webapp/app/routes/vercel.onboarding.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export async function loader({ request }: LoaderFunctionArgs) {
6969

7070
if (!params.success) {
7171
logger.error("Invalid params for Vercel onboarding", { error: params.error });
72-
throw redirectWithErrorMessage(
72+
throw await redirectWithErrorMessage(
7373
"/",
7474
request,
7575
"Invalid installation parameters. Please try again from Vercel."
@@ -89,7 +89,7 @@ export async function loader({ request }: LoaderFunctionArgs) {
8989

9090
if (!params.data.code) {
9191
logger.error("Missing code parameter for Vercel onboarding");
92-
throw redirectWithErrorMessage(
92+
throw await redirectWithErrorMessage(
9393
"/",
9494
request,
9595
"Invalid installation parameters. Please try again from Vercel."
@@ -151,7 +151,7 @@ export async function loader({ request }: LoaderFunctionArgs) {
151151
organizationId: params.data.organizationId,
152152
userId,
153153
});
154-
throw redirectWithErrorMessage("/", request, "Organization not found. Please try again.");
154+
throw await redirectWithErrorMessage("/", request, "Organization not found. Please try again.");
155155
}
156156

157157
return typedjson({

0 commit comments

Comments
 (0)