fix(web): Remove re-throw from loadConversation to prevent unhandled rejections
- Make loadConversation fully self-contained like sendMessage (handle errors internally via state, onError callback, and structured logging) - Remove duplicate try/catch+log from Chat.tsx imperative handle - Replace re-throw tests with delegation and no-throw tests - Add hook-level loadConversation error path tests (getIdea rejection) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -94,12 +94,7 @@ export const Chat = forwardRef<ChatRef, ChatProps>(function Chat(
|
||||
// Expose methods to parent via ref
|
||||
useImperativeHandle(ref, () => ({
|
||||
loadConversation: async (cId: string): Promise<void> => {
|
||||
try {
|
||||
await loadConversation(cId);
|
||||
} catch (err) {
|
||||
console.error("Failed to load conversation", { error: err, conversationId: cId });
|
||||
throw err;
|
||||
}
|
||||
await loadConversation(cId);
|
||||
},
|
||||
startNewConversation: (projectId?: string | null): void => {
|
||||
startNewConversation(projectId);
|
||||
|
||||
Reference in New Issue
Block a user