Skip to content

Editor tabs are duplicated in session state on every restore; untitled notes can't be closed #31544

Closed

Description

@DaveDev42

What happens

Editor tabs are duplicated in the persisted session on every launch. The same file ends up with many tabs, and the count only grows across relaunches. Untitled notes are the worst case: a phantom untitled.md with no file on disk can't be closed in a way that survives a restart, so it keeps coming back.

On my profile right now, unifiedTabs in profile-state.db holds, for a single entityId each:

  • docs/TODO.md — 8 tabs (file exists)
  • untitled.md in one worktree — 5 tabs (0-byte file on disk)
  • untitled.md in another worktree — 5 tabs (no file on disk at all)
  • a scratchpad .md — 4 tabs (no file on disk)

Each duplicate is a distinct unifiedTabs entry with the same entityId and contentType: "editor", a different id form, and an incrementing sortOrder (0, 1, 2, …). They share one groupId.

Repro

  1. Open a markdown file (or a new untitled note) in a worktree.
  2. Quit and relaunch Orca (or let any auto-relaunch restart it).
  3. The tab is restored, but as an additional entry rather than the same one — so after a few relaunches you have several tabs for the one file. For an untitled note with no file on disk, closing it doesn't stick and it returns on the next restore.

Why I think this happens

  • On restore, an editor tab is re-added by entityId without being reconciled against a tab that's already present (or one that was deliberately closed), so each launch appends another copy. Nothing dedupes or evicts, so the entries accumulate without bound.
  • For an untitled note with editorAutoSave=false, there's no file to anchor to and no saved content, so it can neither be saved to disk nor closed durably — it just reappears.

I read this from profile-state.db (the settings, workspaceSession documents). I haven't stepped through the tab-restore source, so the exact path is a guess; the observable facts are the duplicate unifiedTabs entries and the resurrection.

Expected

  • Restoring a session doesn't duplicate an editor tab that's already there; one entityId maps to one tab per group.
  • A closed tab stays closed across a relaunch, including an untitled note.

Notes

Activity

  1. DaveDev42 commented on Oct 22, 2026

    @DaveDev42
    ContributorAuthor

    Found the cause: a desktop republishes editor tabs it only mirrors from a paired host, and editor tab ids embed the runtime environment, so every hop adds a new id for the same file.

  2. DaveDev42 commented on Nov 9, 2026

    @DaveDev42
    ContributorAuthor

    Checked my saved sessions on 1.4.254 (macOS and Windows) and there are no duplicate editor tabs anymore. #33259 and #31984 fixed it, thanks! Closing this. If a closed untitled note keeps coming back, I'll open a separate issue for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions