opencode
opencode copied to clipboard
bug(webui): archived session "flashes back" due to SSE race condition
Problem
When archiving a session in WebUI sidebar, the session briefly disappears then reappears (~100ms later).
Possible Cause
The session.archive API may trigger a session.updated SSE event before archive completes. The optimistic update removes the session, but then the stale event re-adds it.
Suggestion
Use the same logic as TUI - call session.delete API instead, which sends a session.deleted event and avoids confusion with update events.
Video
https://github.com/user-attachments/assets/c59114b8-a2dd-4419-9168-282413494b09