Skip to content

fix(app): restore project and session sync across browsers - #48143

Open
tbnhan wants to merge 7 commits into
anomalyco:devfrom
tbnhan:tbnhan
Open

fix(app): restore project and session sync across browsers#48143
tbnhan wants to merge 7 commits into
anomalyco:devfrom
tbnhan:tbnhan

Conversation

@tbnhan

@tbnhan tbnhan commented Sep 9, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #45011

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Projects and home sessions could become out of sync when the same OpenCode data was accessed from multiple browsers or server contexts.

This PR:

  • Notifies the app when projects are loaded or updated so they can be discovered in the active browser.
  • Discovers project directories referenced by Home sessions.
  • Loads late-discovered project sessions through a deduplicated sequential queue.
  • Normalizes worktree paths when opening, closing, removing, expanding, collapsing, moving, or discovering projects.
  • Persists dismissed projects so a user-closed project is not automatically reopened by background discovery.
  • Migrates legacy recentlyClosed and non-local server state into the canonical local state.
  • Adds handling for global project update events.
  • Disables the channel database for the Desktop server.
  • Adds regression tests covering cross-browser project updates, session discovery, path normalization, migration, dismissal persistence, and queued session loading.

These changes keep project and session state consistent across browser instances while preserving explicit user actions such as closing or reopening a project.

How did you verify your code works?

Added and updated Bun tests covering:

  • Global project bootstrap and project update events.
  • Home session directory discovery.
  • Sequential and deduplicated project session loading.
  • Normalized worktree paths.
  • Project dismissal and rediscovery behavior.
  • Legacy state migration.

The full test suite should be run locally before submitting the PR.

Screenshots / recordings

Not applicable. This PR changes synchronization and state management behavior without introducing a new UI.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this RP††

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

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

Based on my search, I found one potentially related PR:

Related PR:

The current PR (48143) is comprehensive in addressing project and session synchronization across browsers. The searches confirm no other duplicate PRs exist that address the same cross-browser sync issue, path normalization, or dismissal persistence features.

@github-actions github-actions Bot removed needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

[Web] Sessions created from CLI/TUI never appear in web Home until the project is manually added in that browser (client-side-only project registry)

1 participant