Closed Bug 2074385 Opened 2 months ago Closed 1 month ago

Type the closed tab records in SessionStore.sys.mjs

Categories

(Firefox :: Session Restore, task)

task

Tracking

()

RESOLVED FIXED
159 Branch
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.

Blocks: 2074388

#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.

Assignee: nobody → dao+bmo
Status: NEW → ASSIGNED
Attachment #9650350 - Attachment description: Bug 2074385 - Type the closed tab records in SessionStore.sys.mjs. r?sthompson! → Bug 2074385 - Type the closed tab records in SessionStore.sys.mjs. r?sfoster!
Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/83b6c4e20f3b https://hg.mozilla.org/integration/autoland/rev/d3ad76d6adae Type the closed tab records in SessionStore.sys.mjs. r=sessionstore-reviewers,sfoster
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 159 Branch
QA Whiteboard: [qa-triage-done-c160/b159]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: