Skip to content

Conversation

@pointu-l
Copy link

@pointu-l pointu-l commented Jan 25, 2026

With large session counts, the stored sessions retrieval is slower. Creating a session while a request is in-flight causes the UI to disappear when the stored sessions list replaces the store.

The session view depends on sync.session.get(route.sessionID) (index.tsx:114) rendered via <Show when={session()}> (index.tsx:962). When the store is replaced without the new session, session() becomes undefined and the Show renders nothing.

This fix merges the stored sessions with existing sessions instead of replacing, preserving newly-created sessions. Deduplication is covered by usage of Map.

Verification I did:

  • With ~13k sessions, created a new session during an in-flight list request
  • UI no longer disappears or blink when stored sessions response arrives in store

Fixes #10578

@github-actions
Copy link
Contributor

Hey! Your PR title merge session list to prevent stored sessions retrieval to overwrite active (new) session doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@pointu-l pointu-l changed the title merge session list to prevent stored sessions retrieval to overwrite active (new) session fix(TUI): merge session list to prevent stored sessions retrieval to overwrite active (new) session Jan 25, 2026
@pointu-l pointu-l changed the title fix(TUI): merge session list to prevent stored sessions retrieval to overwrite active (new) session fix(opencode): merge session list to prevent stored sessions retrieval to overwrite active (new) session Jan 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New session UI disappears when stored session list response is late

1 participant