From cfc292c7be807f172175ac7e8693bc61b847f6b3 Mon Sep 17 00:00:00 2001 From: JeongwooSeo Date: Sat, 7 Feb 2026 00:35:19 +0900 Subject: [PATCH 1/6] =?UTF-8?q?feat:=20error,=20loading=20ui=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/posts/[slug]/error.tsx | 50 ++++++++++++++++++++++++++++++++++++ app/posts/[slug]/loading.tsx | 12 +++++++++ 2 files changed, 62 insertions(+) create mode 100644 app/posts/[slug]/error.tsx create mode 100644 app/posts/[slug]/loading.tsx diff --git a/app/posts/[slug]/error.tsx b/app/posts/[slug]/error.tsx new file mode 100644 index 0000000..5aefa88 --- /dev/null +++ b/app/posts/[slug]/error.tsx @@ -0,0 +1,50 @@ +'use client'; + +import Link from 'next/link'; +import { useEffect } from 'react'; + +export default function Error({ + error, + reset, +}: { + error: Error & { digest?: string }; + reset: () => void; +}) { + useEffect(() => { + console.error('Post detail error:', error); + }, [error]); + + return ( +
+
+

+ 글을 불러오는데 실패했습니다 +

+

+ {error.message === 'Post not found' + ? '요청하신 글을 찾을 수 없습니다.' + : '일시적인 오류가 발생했습니다. 잠시 후 다시 시도해주세요.'} +

+
+ + + 목록으로 + +
+ {error.digest && ( +

+ 오류 ID: {error.digest} +

+ )} +
+
+ ); +} diff --git a/app/posts/[slug]/loading.tsx b/app/posts/[slug]/loading.tsx new file mode 100644 index 0000000..8193b36 --- /dev/null +++ b/app/posts/[slug]/loading.tsx @@ -0,0 +1,12 @@ +import SVGLoadingSpinner from '@/app/entities/common/Loading/SVGLoadingSpinner'; + +export default function Loading() { + return ( +
+ +

+ 글을 불러오는 중... +

+
+ ); +} From 35b73ec4bae1db8acf68fd4056436747a5eda17e Mon Sep 17 00:00:00 2001 From: JeongwooSeo Date: Sat, 7 Feb 2026 00:39:51 +0900 Subject: [PATCH 2/6] =?UTF-8?q?fix:=20db=20=EC=84=A4=EC=A0=95=20=EC=B5=9C?= =?UTF-8?q?=EC=A0=81=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/lib/dbConnect.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/lib/dbConnect.ts b/app/lib/dbConnect.ts index 6e3b67d..88c8901 100644 --- a/app/lib/dbConnect.ts +++ b/app/lib/dbConnect.ts @@ -66,10 +66,12 @@ async function dbConnect(uri?: string, retries = 3): Promise { const opts = { bufferCommands: false, maxPoolSize: 10, - minPoolSize: 2, - serverSelectionTimeoutMS: 5000, - socketTimeoutMS: 45000, - connectTimeoutMS: 10000, + minPoolSize: 1, + serverSelectionTimeoutMS: 3000, + socketTimeoutMS: 20000, + connectTimeoutMS: 5000, + maxIdleTimeMS: 30000, + waitQueueTimeoutMS: 5000, }; cached.promise = mongoose From 8eb7490a6b6c182c733d2b730c6fa0ee502e22e5 Mon Sep 17 00:00:00 2001 From: JeongwooSeo Date: Sat, 7 Feb 2026 14:57:00 +0900 Subject: [PATCH 3/6] fix: suspense fallback use loading ui --- app/posts/layout.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/posts/layout.tsx b/app/posts/layout.tsx index 16137b0..fcb9de5 100644 --- a/app/posts/layout.tsx +++ b/app/posts/layout.tsx @@ -1,11 +1,11 @@ import { Suspense } from 'react'; -import SVGLoadingSpinner from '@/app/entities/common/Loading/SVGLoadingSpinner'; +import Loading from './[slug]/loading'; interface LayoutProps { children: React.ReactNode; } const Layout = ({ children }: LayoutProps) => { - return }>{children}; + return }>{children}; }; export default Layout; From 62ee0276fe8e232a68fa29c7e8f60b8c3f162cc4 Mon Sep 17 00:00:00 2001 From: JeongwooSeo Date: Sat, 7 Feb 2026 14:57:15 +0900 Subject: [PATCH 4/6] fix: timeout increase --- app/lib/dbConnect.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/lib/dbConnect.ts b/app/lib/dbConnect.ts index 88c8901..4e108c8 100644 --- a/app/lib/dbConnect.ts +++ b/app/lib/dbConnect.ts @@ -67,9 +67,9 @@ async function dbConnect(uri?: string, retries = 3): Promise { bufferCommands: false, maxPoolSize: 10, minPoolSize: 1, - serverSelectionTimeoutMS: 3000, + serverSelectionTimeoutMS: 10000, socketTimeoutMS: 20000, - connectTimeoutMS: 5000, + connectTimeoutMS: 10000, maxIdleTimeMS: 30000, waitQueueTimeoutMS: 5000, }; From 8c8a51b667589ecc0dabb53a68fad0337e720e52 Mon Sep 17 00:00:00 2001 From: JeongwooSeo Date: Sat, 7 Feb 2026 14:57:29 +0900 Subject: [PATCH 5/6] fix: metadata app name --- app/posts/[slug]/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/posts/[slug]/page.tsx b/app/posts/[slug]/page.tsx index a135b2b..ff82057 100644 --- a/app/posts/[slug]/page.tsx +++ b/app/posts/[slug]/page.tsx @@ -60,7 +60,7 @@ export const generateMetadata = async ({ authors: [post.author], }, other: { - 'application-name': 'Shipfriend Tech Blog', + 'application-name': 'ShipFriend TechBlog', author: post.author, publish_date: new Date(post.date).toISOString(), 'og:type': 'article', From 07f52d844ca7c3ba24caa5d4373bb6feecdeb6a4 Mon Sep 17 00:00:00 2001 From: JeongwooSeo Date: Sat, 7 Feb 2026 14:58:08 +0900 Subject: [PATCH 6/6] fix: increase isr validate time 60 to 300 --- app/posts/[slug]/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/posts/[slug]/page.tsx b/app/posts/[slug]/page.tsx index ff82057..96f2944 100644 --- a/app/posts/[slug]/page.tsx +++ b/app/posts/[slug]/page.tsx @@ -21,7 +21,7 @@ export async function generateStaticParams() { } // ISR 활성화하기 -export const revalidate = 60; // 60초마다 재검증 +export const revalidate = 300; // 300초(5분)마다 재검증 async function getPostDetail(slug: string) { await dbConnect();