Skip to content

๐ŸŸ [P1] fix(frontend): ConnectionList switch handler has unhandled async rejectionย #80

Description

@teddylee777

์ปจํ…์ŠคํŠธ ๋ธ”๋ก

Key Value
Category frontend
Checklist ISS-UI-R2 โ€” Uncaught promise rejections in event handlers
Priority P1 ๐ŸŸ 
Scan Date 2026-04-16
Flagged By @code-review

์š”์•ฝ

  • WHAT: handleSwitchConnection์€ async ํ•จ์ˆ˜๋กœ์„œ onClick/onKeyDown์— ๋ฐ”๋กœ ์ „๋‹ฌ๋จ. ๋‚ด๋ถ€์—์„œ ํ˜ธ์ถœํ•˜๋Š” switchConnection()์ด server action updateConnectionAction์„ awaitํ•˜์ง€๋งŒ try/catch ์—†์Œ
  • WHY: ๋„คํŠธ์›Œํฌ ์žฅ์•  ๋˜๋Š” ์„œ๋ฒ„ ์•ก์…˜ ์‹คํŒจ ์‹œ promise rejection์ด globalUnhandledRejection์œผ๋กœ ๋น ์ง. UI๋Š” ์•„๋ฌด ํ”ผ๋“œ๋ฐฑ ์—†์ด ๋ฉˆ์ถ˜ ๋“ฏ ๋ณด์ด๊ณ , ์‚ฌ์šฉ์ž๋Š” ๊ณ„์† ํด๋ฆญ ์‹œ๋„ํ•˜๋ฉฐ UX ์•…ํ™”
  • WHERE: frontend/src/shared/components/settings/ConnectionList.tsx:106-121, :242 (ํ•ธ๋“ค๋Ÿฌ ๋“ฑ๋ก)
  • SEVERITY: HIGH โ€” ์‚ฌ์šฉ์ž๊ฐ€ ์žฅ์• ๋ฅผ ์ธ์ง€ํ•˜์ง€ ๋ชปํ•˜๊ณ  ๋ฐ˜๋ณต ํด๋ฆญ โ†’ ๋ฐ์ดํ„ฐ ๋ถˆ์ผ์น˜ ๊ฐ€๋Šฅ

Evidence

# File Line Finding Flagged By Confidence
1 frontend/src/shared/components/settings/ConnectionList.tsx 106-121 handleSwitchConnection = async (connection) => { await switchConnection(connection.id) } โ€” try/catch ์—†์Œ @code-review High
2 frontend/src/shared/components/settings/ConnectionList.tsx 242 onClick={() => handleSwitchConnection(connection)} โ€” async ํ•จ์ˆ˜๋ฅผ ๋ฐ”๋กœ ํ•ธ๋“ค๋Ÿฌ๋กœ ์ „๋‹ฌ, rejection ๋ฌด์‹œ @code-review High
3 frontend/src/providers/AssistantConfig.tsx (์ฐธ๊ณ ) โ€” ์œ ์‚ฌ ํŒจํ„ด ๋‹ค๋ฅธ ๊ณณ์—๋„ ์กด์žฌ โ€” ํ”„๋กœ์ ํŠธ ์ „๋ฐ˜ async ์—๋Ÿฌ ํ•ธ๋“ค๋ง ๋ถ€์กฑ @code-review Medium

์˜ํ–ฅ ๋ถ„์„

์˜ํ–ฅ ๋ฒ”์œ„

  • ์—ฐ๊ฒฐ ์ „ํ™˜ ์‹œ๋„ํ•˜๋Š” ๋ชจ๋“  ์‚ฌ์šฉ์ž
  • LangGraph ์„œ๋ฒ„ ์žฅ์•  / ๋„คํŠธ์›Œํฌ ๋ถˆ์•ˆ์ • ํ™˜๊ฒฝ

์žฅ์•  ์‹œ๋‚˜๋ฆฌ์˜ค

  1. ์‚ฌ์šฉ์ž๊ฐ€ Connection A์—์„œ B๋กœ ์ „ํ™˜ ํด๋ฆญ
  2. ๋„คํŠธ์›Œํฌ ์ผ์‹œ ์žฅ์• ๋กœ updateConnectionAction throw
  3. UI๋Š” ์•„๋ฌด ํ‘œ์‹œ ์—†์ด ๊ธฐ์กด Connection A ์ƒํƒœ ์œ ์ง€
  4. ์‚ฌ์šฉ์ž๊ฐ€ B๋กœ ์ „ํ™˜๋œ ์ค„ ์•Œ๊ณ  ์ฑ„ํŒ… โ†’ ์ž˜๋ชป๋œ assistant์— ๋ฉ”์‹œ์ง€ ์ „์†ก
  5. ๋˜๋Š” ์‚ฌ์šฉ์ž๊ฐ€ ๋ฐ˜๋ณต ํด๋ฆญ โ†’ ์—ฌ๋Ÿฌ transition ๋ ˆ์ด์Šค ์ปจ๋””์…˜

๊ธด๊ธ‰๋„

  • ๋„คํŠธ์›Œํฌ ์˜ค๋ฅ˜๋Š” ์ƒ์‹œ ๋ฐœ์ƒ ๊ฐ€๋Šฅํ•œ ์ผ๋ฐ˜์  ์‹œ๋‚˜๋ฆฌ์˜ค
  • ์‚ฌ์ผ๋ŸฐํŠธ ์‹คํŒจ๋Š” ๋””๋ฒ„๊น… ์–ด๋ ค์›€

์ œ์•ˆ ํ•ด๊ฒฐ ๋ฐฉ์•ˆ

์ ‘๊ทผ ๋ฐฉ๋ฒ•

handleSwitchConnection์— try/catch + ์‚ฌ์šฉ์ž ํ”ผ๋“œ๋ฐฑ ์ถ”๊ฐ€:

const handleSwitchConnection = async (connection: Connection) => {
  setIsSwitching(connection.id);
  try {
    await switchConnection(connection.id);
    toast.success(\"Connection switched\");
  } catch (error) {
    console.error(\"[ConnectionList] switch failed\", error);
    toast.error(\"Failed to switch connection. Please try again.\");
  } finally {
    setIsSwitching(null);
  }
};

์ถ”๊ฐ€๋กœ onClick ํ•ธ๋“ค๋Ÿฌ ๋‚ด๋ถ€์—์„œ fire-and-forget์„ ๋ช…์‹œ์ ์œผ๋กœ:

onClick={() => { void handleSwitchConnection(connection); }}

์ „ ํ”„๋กœ์ ํŠธ ๊ณตํ†ต ํŒจํ„ด์œผ๋กœ useAsyncHandler ๋˜๋Š” safeAsync ์œ ํ‹ธ์„ ๋„์ž…ํ•ด ์ผ๊ด€์„ฑ ํ™•๋ณด ๊ณ ๋ ค.

๋Œ€์•ˆ

  • window.onunhandledrejection ๊ธ€๋กœ๋ฒŒ ์ฒ˜๋ฆฌ: ์ตœํ›„์˜ ๋ณด๋ฃจ์ง€๋งŒ context ์ •๋ณด ๋ถ€์กฑ
  • sonner/react-hot-toast ๊ฐ™์€ ์ „์—ญ ์—๋Ÿฌ ํ† ์ŠคํŠธ: ์ด๋ฏธ ํ”„๋กœ์ ํŠธ์— toast ์‹œ์Šคํ…œ์ด ์žˆ๋‹ค๋ฉด ํ™œ์šฉ

์ˆ˜์šฉ ๊ธฐ์ค€

  • handleSwitchConnection์— try/catch ์ถ”๊ฐ€
  • ์—๋Ÿฌ ์‹œ ์‚ฌ์šฉ์ž์—๊ฒŒ toast ๋˜๋Š” inline ์—๋Ÿฌ ํ‘œ์‹œ
  • isSwitching state๋กœ ๋ฒ„ํŠผ disabled ์ฒ˜๋ฆฌ (์ค‘๋ณต ํด๋ฆญ ๋ฐฉ์ง€)
  • ํ…Œ์ŠคํŠธ: LangGraph ์„œ๋ฒ„ ์ค‘์ง€ ์ƒํƒœ์—์„œ ์ „ํ™˜ ์‹œ๋„ โ†’ ์—๋Ÿฌ ํ† ์ŠคํŠธ ํ™•์ธ
  • ํ…Œ์ŠคํŠธ ์ปค๋งจ๋“œ: cd frontend && pnpm test

์ฐธ์กฐ

  • ๊ด€๋ จ ํŒŒ์ผ: frontend/src/shared/components/settings/ConnectionList.tsx
  • Checklist ํ•ญ๋ชฉ: ISS-UI-R2
  • ๊ด€๋ จ ์ด์Šˆ: ์—†์Œ

์žฌํ˜„ ๋ฐฉ๋ฒ•

์‚ฌ์ „ ์กฐ๊ฑด

  • dev ์„œ๋ฒ„ ์‹คํ–‰, ์—ฐ๊ฒฐ 2๊ฐœ ์ด์ƒ ์„ค์ •๋จ

๋‹จ๊ณ„

  1. ๋„คํŠธ์›Œํฌ throttling์„ "offline"์œผ๋กœ ์„ค์ • (DevTools > Network)
  2. ๋‹ค๋ฅธ ์—ฐ๊ฒฐ๋กœ ์ „ํ™˜ ํด๋ฆญ
  3. ์‘๋‹ต ๊ด€์ฐฐ

๊ธฐ๋Œ€ ๊ฒฐ๊ณผ

์—๋Ÿฌ ํ† ์ŠคํŠธ/๋ฉ”์‹œ์ง€ ํ‘œ์‹œ + ๋ฒ„ํŠผ ๋ณต๊ตฌ

์‹ค์ œ ๊ฒฐ๊ณผ

UI ์ •์ง€, ์—๋Ÿฌ ๋ฉ”์‹œ์ง€ ์—†์Œ, DevTools Console์— unhandled rejection

๊ด€๋ จ ์ฝ”๋“œ ์ปจํ…์ŠคํŠธ

File Role Relevance
frontend/src/shared/components/settings/ConnectionList.tsx ์—ฐ๊ฒฐ ๊ด€๋ฆฌ UI ์ˆ˜์ • ๋Œ€์ƒ
frontend/src/app/actions.ts updateConnectionAction server action ์—๋Ÿฌ throw ์ฃผ์ฒด
frontend/src/shared/hooks/useToast.ts ๋˜๋Š” ์œ ์‚ฌ toast ์‹œ์Šคํ…œ ํ™œ์šฉ

Detected by oh-my-braincrew `omb:issue` scan
Category: frontend | Scan date: 2026-04-16
`omb-issue-scan category=frontend checklist=ISS-UI-R2`

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions