diff --git a/apps/web/src/app/notification/_utils/getNotificationRoute.ts b/apps/web/src/app/notification/_utils/getNotificationRoute.ts index 9cc0ac45..bf0e1a11 100644 --- a/apps/web/src/app/notification/_utils/getNotificationRoute.ts +++ b/apps/web/src/app/notification/_utils/getNotificationRoute.ts @@ -18,6 +18,7 @@ export const getNotificationRoute = ( case 'TOURNAMENT_RESULT_READY': return ROUTES.TOURNAMENT_RESULT(refId); case 'ITEM_PARSING_COMPLETED': + case 'ITEM_PARSING_INCOMPLETE': case 'ITEM_PARSING_FAILED': if (extra?.kind === 'TOURNAMENT' && extra.tournamentId) { return ROUTES.TOURNAMENT_CREATE(extra.tournamentId); diff --git a/apps/web/src/hooks/useNotificationSSE.ts b/apps/web/src/hooks/useNotificationSSE.ts index 62071d5e..87afea04 100644 --- a/apps/web/src/hooks/useNotificationSSE.ts +++ b/apps/web/src/hooks/useNotificationSSE.ts @@ -167,6 +167,8 @@ export const useNotificationSSE = (enabled: boolean) => { } toast.success(message); break; + /** 미완성·실패 모두 동일한 데이터를 갱신하고, 사용자 안내만 다르다. */ + case 'ITEM_PARSING_INCOMPLETE': case 'ITEM_PARSING_FAILED': if (payload.kind === 'TOURNAMENT' && payload.tournamentId != null) { queryClient.invalidateQueries({ @@ -178,7 +180,11 @@ export const useNotificationSSE = (enabled: boolean) => { predicate: query => isWishQueryOfItem(query, payload.refId), }); } - toast.error(message, { duration: 5000 }); + if (payload.type === 'ITEM_PARSING_INCOMPLETE') { + toast.info(message, { duration: 5000 }); + } else { + toast.error(message, { duration: 5000 }); + } break; case 'TOURNAMENT_STARTED': queryClient.invalidateQueries({ queryKey: ['tournament', payload.refId] }); diff --git a/apps/web/src/types/notification.ts b/apps/web/src/types/notification.ts index c7e0d2ee..29c1edae 100644 --- a/apps/web/src/types/notification.ts +++ b/apps/web/src/types/notification.ts @@ -7,6 +7,7 @@ export type NotificationTypeT = | 'TOURNAMENT_COMPLETED' | 'TOURNAMENT_RESULT_READY' | 'ITEM_PARSING_COMPLETED' + | 'ITEM_PARSING_INCOMPLETE' | 'ITEM_PARSING_FAILED' | 'ANNOUNCEMENT'; @@ -40,7 +41,7 @@ export type SilentSyncSsePayloadT = type: 'TOURNAMENT_ITEM_PARSED'; tournamentId: number; tournamentItemId: number; - status: 'READY' | 'FAILED'; + status: 'READY' | 'INCOMPLETE' | 'FAILED'; } | { type: 'UNREAD_COUNT_CHANGED'; diff --git a/apps/web/src/utils/pushNotificationRoute.ts b/apps/web/src/utils/pushNotificationRoute.ts index 0a72bb7d..20de0a6d 100644 --- a/apps/web/src/utils/pushNotificationRoute.ts +++ b/apps/web/src/utils/pushNotificationRoute.ts @@ -8,6 +8,7 @@ export const getPushNotificationRoute = (payload: DeepLinkPayloadT) => { case PUSH_NOTIFICATION_TYPE.TOURNAMENT_ITEM_ADDED: return ROUTES.TOURNAMENT_CREATE(payload.refId); case PUSH_NOTIFICATION_TYPE.ITEM_PARSING_COMPLETED: + case PUSH_NOTIFICATION_TYPE.ITEM_PARSING_INCOMPLETE: case PUSH_NOTIFICATION_TYPE.ITEM_PARSING_FAILED: if (payload.kind === 'TOURNAMENT' && payload.tournamentId) { return ROUTES.TOURNAMENT_CREATE(payload.tournamentId); diff --git a/packages/core/src/consts/webBridge.ts b/packages/core/src/consts/webBridge.ts index 225d2f35..1122e5d1 100644 --- a/packages/core/src/consts/webBridge.ts +++ b/packages/core/src/consts/webBridge.ts @@ -60,6 +60,7 @@ export const PUSH_NOTIFICATION_TYPE = { TOURNAMENT_JOINED: 'TOURNAMENT_JOINED', TOURNAMENT_ITEM_ADDED: 'TOURNAMENT_ITEM_ADDED', ITEM_PARSING_COMPLETED: 'ITEM_PARSING_COMPLETED', + ITEM_PARSING_INCOMPLETE: 'ITEM_PARSING_INCOMPLETE', ITEM_PARSING_FAILED: 'ITEM_PARSING_FAILED', } as const; diff --git a/packages/core/src/types/pushNotification.ts b/packages/core/src/types/pushNotification.ts index e0b0caf8..2ec87d50 100644 --- a/packages/core/src/types/pushNotification.ts +++ b/packages/core/src/types/pushNotification.ts @@ -53,7 +53,7 @@ export type DeepLinkPayloadT = refId: number; } | { - type: 'ITEM_PARSING_COMPLETED' | 'ITEM_PARSING_FAILED'; + type: 'ITEM_PARSING_COMPLETED' | 'ITEM_PARSING_INCOMPLETE' | 'ITEM_PARSING_FAILED'; refId: number; kind: 'WISH' | 'TOURNAMENT'; tournamentId?: number;