From ff73cb7ce5da7c678d32ecb3dd6dc936d6aea08d Mon Sep 17 00:00:00 2001 From: Mayne0213 Date: Fri, 13 Mar 2026 21:44:38 +0900 Subject: [PATCH] FIX(mypage): handle kubernetes API failure gracefully - Separate kubernetes query from useAppSuspenseQueries - Use independent useAppQuery with retry disabled - Show fallback message when kubernetes key is unavailable - Prevent entire my-page from crashing on kubernetes 404 Co-Authored-By: Claude Opus 4.6 --- .../components/my-page/MyPageContainer.tsx | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/websites/poolc.org/src/components/my-page/MyPageContainer.tsx b/websites/poolc.org/src/components/my-page/MyPageContainer.tsx index d8945fd..9fb3411 100644 --- a/websites/poolc.org/src/components/my-page/MyPageContainer.tsx +++ b/websites/poolc.org/src/components/my-page/MyPageContainer.tsx @@ -3,7 +3,7 @@ import { Link } from 'react-router-dom'; import { ArrowRightOutlined, EditTwoTone, MessageTwoTone, QuestionCircleFilled, StarTwoTone, UserOutlined } from '@ant-design/icons'; import { createStyles } from 'antd-style'; import { useEffect, useRef } from 'react'; -import { BadgeControllerService, BaekjoonControllerService, KubernetesControllerService, MemberControllerService, queryKey, useAppMutation, useAppSuspenseQueries } from '~/lib/api-v2'; +import { BadgeControllerService, BaekjoonControllerService, KubernetesControllerService, MemberControllerService, queryKey, useAppMutation, useAppQuery, useAppSuspenseQueries } from '~/lib/api-v2'; import { MENU } from '~/constants/menus'; import MyPageGrassSection from '~/components/my-page/MyPageGrassSection'; import { queryClient } from '~/lib/utils/queryClient'; @@ -42,7 +42,7 @@ export default function MyPageContainer({ locationHash }: { locationHash: string }, ]; - const [{ data: myHour }, { data: me }, { data: badge }, { data: baekjoon }, { data: kubernetes }] = useAppSuspenseQueries({ + const [{ data: myHour }, { data: me }, { data: badge }, { data: baekjoon }] = useAppSuspenseQueries({ queries: [ { queryKey: queryKey.member.hour, @@ -60,13 +60,15 @@ export default function MyPageContainer({ locationHash }: { locationHash: string queryKey: queryKey.baekjoon.baekjoon, queryFn: BaekjoonControllerService.getMyBaekjoonUsingGet, }, - { - queryKey: queryKey.kubernetes.me, - queryFn: KubernetesControllerService.getMyKeyUsingGet, - }, ], }); + const { data: kubernetes, isError: isKubernetesError } = useAppQuery({ + queryKey: queryKey.kubernetes.me, + queryFn: KubernetesControllerService.getMyKeyUsingGet, + retry: false, + }); + const { mutate: selectBadge } = useAppMutation({ mutationFn: BadgeControllerService.selectBadgeUsingPost, }); @@ -199,7 +201,11 @@ export default function MyPageContainer({ locationHash }: { locationHash: string PKS (PoolC Kubernetes Service) - + {isKubernetesError ? ( + 쿠버네티스 키가 아직 발급되지 않았습니다. 관리자에게 문의해주세요. + ) : kubernetes?.key ? ( + + ) : null} );