Skip to content

[Bug]: Closing an editor document also closes a pinned duplicate of it, and setActiveFile accepts an id with no open file #27985

Closed

Description

@BearMett

Operating system

macOS

Orca version

main (41fc9542b3), development build

Details

Summary

Two small gaps remain in editor close and selection, from reading the code on main (93e0b80be7).

1. A pinned duplicate is closed along with its twin

Since c9f4cd7e27, closeFile also closes clean duplicate records of the same document with the same owner. Duplicates like this exist in stores written by older builds (see #21121). The sweep skips dirty records and records with a draft, but not records whose tab is pinned.

Steps

  1. In one workspace, have two clean open-file records for the same file and owner, each with its own editor tab.
  2. Pin one of the tabs.
  3. Close the other tab.

Expected: the pinned tab and its record stay open.

Actual: both records and both tabs close.

2. setActiveFile accepts an id with no open file

A stale tab or pane id can reach setActiveFile with a file id that has no OpenFile record. #21121 describes the path: recent-tab cycling → activateCyclableTab → setActiveFile.

Steps

  1. Have an open editor file active in the active workspace.
  2. Call setActiveFile with an id that no open file has, without naming another workspace.

Expected: nothing changes.

Actual: the missing id becomes the global active file (activeFileId). The per-workspace entry is not changed.

Scope

Only these two guards. Duplicate records themselves, and how they arise, are out of scope here. See #21121.

Activity

  1. added
    os:macos
    on Oct 12, 2026
  2. AmethystLiang commented on Oct 12, 2026

    @AmethystLiang
    Contributor

    Thanks for reporting. Looking into it

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

Metadata

Metadata

Assignees

Labels

os:macos

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions