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

Open
opened 2026-02-16 17:45:25 -05:00 by yindo · 1 comment
Owner

Originally created by @hotic on GitHub (Jan 11, 2026).

Originally assigned to: @adamdotdevin on GitHub.

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

Originally created by @hotic on GitHub (Jan 11, 2026). Originally assigned to: @adamdotdevin on GitHub. ## 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
yindo added the web label 2026-02-16 17:45:25 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 11, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #5760: Context size in sidebar not updated after /compact - similar SSE/sidebar state synchronization issue
  • #5934: Session Todo-list is forgotten after compaction - related to session state persistence after backend operations
  • #7555: Session Changes / Modified Files show changes from origin/main - another sidebar data consistency issue with stale information

All three share the core pattern of WebUI/sidebar state being out of sync with backend state. Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 11, 2026): This issue might be a duplicate of existing issues. Please check: - #5760: Context size in sidebar not updated after /compact - similar SSE/sidebar state synchronization issue - #5934: Session Todo-list is forgotten after compaction - related to session state persistence after backend operations - #7555: Session Changes / Modified Files show changes from origin/main - another sidebar data consistency issue with stale information All three share the core pattern of WebUI/sidebar state being out of sync with backend state. Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4783