From d0fdadeefacbf8024aa62553d9645e097936fbbf Mon Sep 17 00:00:00 2001 From: d-kimsuon Date: Sat, 6 Sep 2025 23:38:49 +0900 Subject: [PATCH] feat: set timeout for new-chat & resume-chat --- .../[projectId]/components/newChat/NewChat.tsx | 15 +++++++++++---- .../components/resumeChat/ResumeChat.tsx | 15 +++++++++++---- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/app/projects/[projectId]/components/newChat/NewChat.tsx b/src/app/projects/[projectId]/components/newChat/NewChat.tsx index 3e615a2..f7aa95b 100644 --- a/src/app/projects/[projectId]/components/newChat/NewChat.tsx +++ b/src/app/projects/[projectId]/components/newChat/NewChat.tsx @@ -21,10 +21,17 @@ export const NewChat: FC<{ mutationFn: async (options: { message: string }) => { const response = await honoClient.api.projects[":projectId"][ "new-session" - ].$post({ - param: { projectId }, - json: { message: options.message }, - }); + ].$post( + { + param: { projectId }, + json: { message: options.message }, + }, + { + init: { + signal: AbortSignal.timeout(10 * 1000), + }, + }, + ); if (!response.ok) { throw new Error(response.statusText); diff --git a/src/app/projects/[projectId]/sessions/[sessionId]/components/resumeChat/ResumeChat.tsx b/src/app/projects/[projectId]/sessions/[sessionId]/components/resumeChat/ResumeChat.tsx index 57911c1..485c46e 100644 --- a/src/app/projects/[projectId]/sessions/[sessionId]/components/resumeChat/ResumeChat.tsx +++ b/src/app/projects/[projectId]/sessions/[sessionId]/components/resumeChat/ResumeChat.tsx @@ -24,10 +24,17 @@ export const ResumeChat: FC<{ mutationFn: async (options: { message: string }) => { const response = await honoClient.api.projects[":projectId"].sessions[ ":sessionId" - ].resume.$post({ - param: { projectId, sessionId }, - json: { resumeMessage: options.message }, - }); + ].resume.$post( + { + param: { projectId, sessionId }, + json: { resumeMessage: options.message }, + }, + { + init: { + signal: AbortSignal.timeout(10 * 1000), + }, + }, + ); if (!response.ok) { throw new Error(response.statusText);