fix: resolve race conditions in assistant/cockpit session loading
- Always load session data on mount even when urlSessionId matches activeChatId, fixing empty state after view toggle between /assistant and /cockpit (tasks/messages not showing until sidebar click) - Add loadingRef for synchronous guards preventing duplicate sends, duplicate session creation, and prefill races - Fix stale evidence_items closure in CockpitPage handlers - Move setLoading(true) before first await in handlePrefill and handleResumeNew Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -20,7 +20,7 @@ export default function FlowPilotPage() {
|
||||
}, []) // eslint-disable-line react-hooks/exhaustive-deps
|
||||
|
||||
const handleTaskSubmit = async (responses: Array<{ type: string; state: string; value: string; text?: string; label?: string }>) => {
|
||||
if (!session.activeChatId || session.loading) return
|
||||
if (!session.activeChatId || session.loading || session.loadingRef.current) return
|
||||
|
||||
const parts: string[] = []
|
||||
for (const r of responses) {
|
||||
|
||||
Reference in New Issue
Block a user