Fix session switch race: connect WS after REST fetch completes
loadSession was setting currentId before the REST fetch, which triggered
ws.connect() immediately. If WS replay arrived before the REST response,
onStreamStart() would push a streaming message, then the REST response
would overwrite messages.value entirely — leaving streamingMsg pointing
to an orphaned object no longer in the array.

Fix: move currentId and location.hash assignment to after the REST fetch
so the WS connection is established only once messages are populated.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent b43428a commit 1555e8b78cb20848d8af54740dea2f0bee19cecc
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored on 21 Apr
Showing 4 changed files
View
webclient/dist/assets/index-B3zSedhg.js 100644 → 0
Not supported
View
webclient/dist/assets/index-CtymtXlD.js 0 → 100644
Not supported
View
webclient/dist/index.html
View
webclient/src/stores/chat.js