Open Bug 2065643 (sessionstore-ts) Opened 3 months ago Updated 24 days ago

[meta] Enable TypeScript for all of browser/components/sessionstore

Categories

(Firefox :: Session Restore, task)

task

Tracking

()

ASSIGNED

People

(Reporter: dao, Assigned: dao)

References

Details

(Keywords: meta)

This effort puts every module in browser/components/sessionstore under the tree's TypeScript setup and checks it in CI. The directory is Session Restore, which tracks the windows, tabs and tab groups a user has open, persists that state to disk, and puts it back when Firefox starts again or when the user reopens something they closed. It has twenty modules; the last is a single 9.2k-line one that holds the session state in memory and exposes the API the rest of the front-end calls. The state itself is a JSON tree assembled piecemeal across those modules. A schema validates it on the way to disk, and nothing checked the code that builds it.

None of the machinery is new. Mark Banner built the tree-wide TypeScript linter that checks every component, the compiler settings and the convention for declaring types a checker cannot otherwise see, all for the address bar. This effort follows that road.

What type checking has caught

This is a running list, not a comprehensive audit.

  • Bug 2067051 - Session Restore debug logging never runs in SessionSaver, because Log.Logger has no way to test its effective level
  • Bug 2067068 - "Reopen All Tabs" throws a TypeError when the list includes tabs from closed windows
  • Comments named an open tab where the value is a closed one. Session Restore keeps records of closed tabs and groups that resemble the live ones and are not interchangeable with them. Nothing was broken, but a reader following the comment would have been.
  • Bug 2076655 - Remove userTypedClear from the lazy tab state
  • Bug 2076678 - Reopen Closed Tab fails after deleting a saved tab group
  • Bug 2076724 - Reopen Closed Tab fails after reopening a closed tab group's tabs one at a time
  • Bug 2081861 - Recently Closed Tabs doesn't show closed tab groups from the current window when browser.sessionstore.closedTabsFromAllWindows is false

Progress at a glance

Phase Goal Bug Status
0 Convert SessionStore to a modern class bug 1892761 DONE
1 Complete the documentation and publish an API reference bug 2065591 DONE
2 Land the project file green and wire the CI check bug 2065637 DONE
3 Write the session state shapes down as checkable types bug 2065800, bug 2088936 DONE
4 Fix the debug logging that never ran bug 2067051 DONE
5 Type the lazily-imported modules bug 2066120 DONE
6 Finish typing the lazily-imported modules bug 2067072 DONE
7 Adopt the tab strip's shared element declarations bug 2069194 DONE
8 Build closed and saved tab groups as one shape bug 2069783 DONE
9 Type-check the recently-closed menus bug 2065811 DONE
10 Name the option bags the public methods take bug 2069784, bug 2075123 DONE
11 Type the event and observer entry points bug 2074387 DONE
12 Type the closed tab records bug 2074385 DONE
13 Type the window and browser handles bug 2074386 DONE
14 Type the window geometry restore bug 2074389 DONE
15 Name the restore options bug 2077436 DONE
16 Type the restore history options and the window restoring flag bug 2077435 DONE
17 Take the main module off the exclusion list and under the CI check bug 2074388 DONE
18 Keep SessionStore's window IDs out of expandos on the window bug 2078286 DONE
19 Type-check aboutSessionRestore.js bug 2078351 DONE
20 Type-check the closed data source reads bug 2079177 DONE
21 Replace the frozen forwarding objects with classes bug 2079201 DONE
22 Type the browser windows as BrowserWindow bug 2079204 DONE
23 Convert SessionStartup to a class bug 2079203 DONE
24 Convert StartupPerformance to a class bug 2079202 DONE

References

See Also: → 1964610
Depends on: 2065638
See Also: → tabbrowser-ts
Alias: sessionstore-ts
Depends on: 2065800
Depends on: 2065811
See Also: → sessionstore-docs
Depends on: 2066120
Depends on: 2067051
Depends on: 2067068
Depends on: 2067072
No longer depends on: 2067068
No longer depends on: 2065638
Depends on: 2069194
Depends on: 2069783
Depends on: 2069784
Depends on: 2074385
Depends on: 2074386
Depends on: 2074387
Depends on: 2074388
Depends on: 2074389
Depends on: 2075121
Depends on: 2075123
See Also: → 2067068, 2076655, 2076678, 2076724
See Also: 2067068, 2076655, 2076678, 2076724 →
Depends on: 2077435
Depends on: 2077436
Depends on: 2078286
Depends on: 2078351
Assignee: nobody → dao+bmo
Status: NEW → ASSIGNED
Depends on: 2079177
Depends on: 2079201
Depends on: 2079202
Depends on: 2079203
Depends on: 2079204
Depends on: 2081861
Depends on: 2088936
You need to log in before you can comment on or make changes to this bug.