fix(mission): reconnect SSE stream after submitting interview response
After handleSubmitResponse posted an answer, the stream connection was never re-established, so the next question from the server was never received. The modal would stay on the loading spinner until the user closed and reopened it (which triggered the resume-session reconnect). Fix: call connectToMissionInterviewStream(sessionId) before the API call, matching the pattern used by handleRetryFromError. Also close the stream on API error to match the error-recovery path, and add connectToMissionInterviewStream to the useCallback dependency array. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -569,14 +569,17 @@ export function MissionInterviewModal({
|
||||
setStreamingOutput("");
|
||||
|
||||
try {
|
||||
connectToMissionInterviewStream(sessionId);
|
||||
await respondToMissionInterview(sessionId, responses, projectId, sessionTabId);
|
||||
setHasProgress(true);
|
||||
} catch (err: any) {
|
||||
streamConnectionRef.current?.close();
|
||||
streamConnectionRef.current = null;
|
||||
setError(err.message || "Failed to submit response");
|
||||
setView({ type: "question", sessionId, question: view.question });
|
||||
}
|
||||
},
|
||||
[view, projectId, sessionTabId]
|
||||
[view, projectId, sessionTabId, connectToMissionInterviewStream]
|
||||
);
|
||||
|
||||
const handleRetryFromError = useCallback(async () => {
|
||||
|
||||
Reference in New Issue
Block a user