Type the closed tab records in SessionStore.sys.mjs
Categories
(Firefox :: Session Restore, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox159 | --- | fixed |
People
(Reporter: dao, Assigned: dao)
References
(Blocks 1 open bug)
Details
Attachments
(1 external file)
#getStateForClosedTabsAndClosedGroupTabs returns one ClosedTabStateData or an array of them depending on whether an index is passed, and no caller narrows the result, so every length, find, iteration and single-record argument on it is an error. Splitting it into a one-record and an all-records accessor, or narrowing at the callers, fixes them as a behavior-neutral change.
The closed-tab records built as object literals when a tab closes and when one is restored don't match ClosedTabStateData either, and forgetClosedTabById reads includePrivate before the check that narrows its window-or-options parameter.
The module stays on the exclude list in browser/components/sessionstore/tsconfig.json until the last of the bugs splitting this work up takes it off.
| Assignee | ||
Comment 1•2 months ago
|
||
#getStateForClosedTabsAndClosedGroupTabs always returns the whole merged list, and undoCloseTab, its only caller that passed an index, indexes into it. Dropping the early break is behavior-neutral: every full-list call already writes the same _originalStateIndex values on every entry.
Not behavior-neutral: formatTabStateForSavedGroup returns null for a tab without an in-range history entry, and its three callers skip it, where the deferred-restore and migration paths used to save {} into the group. It also stops writing pos, which has been undefined since bug 1948078 and is never read for saved group tabs.
Updated•2 months ago
|
Updated•2 months ago
|
Comment 3•1 month ago
|
||
| bugherder | ||
Updated•1 month ago
|
Description
•