Bug
When switching channels or when the WebSocket reconnects, messages appear duplicated — identical pairs of user/assistant messages.
Root Cause
sendAllChannelHistory() sends historical messages using the same type: 'message' event as real-time new messages. The frontend App.tsx appends every message event to state without dedup.
On reconnect, history is re-sent → messages double.
Fix Options
- Frontend dedup: check message
id before appending
- Server: use a distinct
channel_history batch event (not individual message events)
- Frontend: clear channel messages on reconnect before loading history
Option 2 is cleanest — separates history from live messages.
Steps to Reproduce
- Open Workshop UI
- Send some messages in a channel
- Switch to another channel and back
- Messages appear duplicated
Bug
When switching channels or when the WebSocket reconnects, messages appear duplicated — identical pairs of user/assistant messages.
Root Cause
sendAllChannelHistory()sends historical messages using the sametype: 'message'event as real-time new messages. The frontendApp.tsxappends everymessageevent to state without dedup.On reconnect, history is re-sent → messages double.
Fix Options
idbefore appendingchannel_historybatch event (not individualmessageevents)Option 2 is cleanest — separates history from live messages.
Steps to Reproduce