- Add 8s polling fallback while view is "loading" so a missed SSE question/summary event self-heals instead of leaving the panel stuck on "thinking" until close+reopen. - Track dismissed resumeSessionIds in a ref and drop loadSession from the resume effect's deps so typing into the textarea no longer re-fires resume and yanks the user back to the previous session. - Guard SSE onThinking/onQuestion/onSummary against late events from a torn-down connection by comparing the captured sessionId against currentSessionIdRef. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1.1 KiB
1.1 KiB
@runfusion/fusion
| @runfusion/fusion |
|---|
| patch |
Fix two issues with question display in planning mode:
- Questions sometimes stayed hidden behind the "thinking" view until the panel was closed and reopened. The live SSE
questionevent could be missed (e.g. when the tab was throttled), and the only path that promoted the view was the live event. Add an 8s polling fallback that refetches the session while the view is in theloadingstate and transitions toquestion/summaryif the server has already moved on, so a dropped event self-heals. - Clicking "New Session" and then typing into the textarea jumped the panel back to the previous session's questions. The "resume on open" effect listed
loadSessionin its deps;loadSessionis recreated wheneverconnectToPlanningStreamchanges, and the latter depends oninitialPlan, so each keystroke re-ran the resume effect and reloaded the dismissed session. Track dismissedresumeSessionIds in a ref and droploadSessionfrom the effect's deps. Also guard the SSEonThinking/onQuestion/onSummaryhandlers against late events from a stale connection so they can't overwrite the new session's view.