🟠 [P1] Fix high-priority error handling in chat overlay (PR #307) #322
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Overview
Code review of PR #307 identified 4 HIGH severity error handling issues that need attention before the next release.
Source: Code review by pr-review-toolkit agents
Related PR: #307
Impact: MEDIUM-HIGH - Poor user experience, debugging difficulties
Issue 1: Silent localStorage Failures
Location:
apps/web/src/hooks/useChatOverlay.ts(lines 42-44, 59-61)Problem:
Both
loadState()andsaveState()catch all errors, log warnings, then silently continue. Users have no idea their chat state isn't being persisted.Hidden Errors:
User Impact:
Fix:
Issue 2: Unhandled Promise Rejections
Location:
apps/web/src/components/chat/Chat.tsx(lines 99-100, 177-179)Problem:
loadConversation()returns Promise that could reject, but imperative handle exposes it without error handling.Hidden Errors:
User Impact:
Fix:
Issue 3: No Separate Save Failure Handling
Location:
apps/web/src/hooks/useChat.ts(line 204)Problem:
saveConversation()errors get lumped with LLM errors, making it unclear what failed.User Impact:
Fix:
Separate LLM errors from persistence errors with different user messages.
Issue 4: No Timeout Handling
Location:
apps/web/src/hooks/useChat.ts(lines 146-236)Problem:
sendMessagecalls API without timeout. If API hangs, loading state persists forever.User Impact:
Fix:
Add AbortController with 60-second timeout.
Acceptance Criteria
Priority
P1 - HIGH - Fix before next release.
Fixed in commit 8d831cf.
All 4 high-priority issues addressed:
Tests: 568 passing