opencode icon indicating copy to clipboard operation
opencode copied to clipboard

bug(webui): archived session "flashes back" due to SSE race condition

Open hotic opened this issue 3 days ago • 1 comments

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

hotic avatar Jan 11 '26 23:01 hotic