You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Closing an editor document also closes a pinned duplicate of it, and setActiveFile accepts an id with no open file #27985
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
In one workspace, have two clean open-file records for the same file and owner, each with its own editor tab.
Pin one of the tabs.
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
Have an open editor file active in the active workspace.
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
AmethystLiang commentedon Oct 12, 2026
Thanks for reporting. Looking into it