fix(web): Address review findings for M4-LLM integration
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/pr/woodpecker Pipeline was successful

- Sanitize user-facing error messages (no raw API/DB errors)
- Remove dead try/catch from Chat.tsx handleSendMessage
- Add onError callback for persistence errors in useChat
- Add console.error logging to loadConversation
- Guard minimize/toggleMinimize against closed overlay state
- Improve error dedup bucketing for non-DOMException errors
- Add tests: non-Error throws, updateConversation failure,
  minimize/toggleMinimize guards

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jason Woltje
2026-02-06 20:25:03 -06:00
parent da1862816f
commit f64ca3871d
6 changed files with 130 additions and 28 deletions

View File

@@ -73,9 +73,6 @@ export const Chat = forwardRef<ChatRef, ChatProps>(function Chat(
} = useChat({
model: "llama3.2",
...(initialProjectId !== undefined && { projectId: initialProjectId }),
onError: (_err) => {
// Error is handled by the useChat hook's state
},
});
// Connect to WebSocket for real-time updates (when we have a user)
@@ -180,11 +177,7 @@ export const Chat = forwardRef<ChatRef, ChatProps>(function Chat(
const handleSendMessage = useCallback(
async (content: string) => {
try {
await sendMessage(content);
} catch (err) {
console.error("Error sending message:", err);
}
await sendMessage(content);
},
[sendMessage]
);