Files
tubestation/browser/components/sessionstore/test
apostrophest 6033809e9c Bug 1956254 - fix saved tab group behavior on session restore r=dwalker,sessionstore-reviewers
Current behavior on Windows: if you close a window that has open tab groups, the tab groups are automatically saved. Opening Firefox into the initial deferred restore state properly shows the tab groups as saved. However, after restoring the previous session manually, the tab groups exist both in the tab strip (correct) and in the list of saved tab groups (incorrect).

Bug 1950611 and bug 1954488 dealt with several edge cases around saved groups + session restore. In Windows, it looks like on session startup, `_prepDataForDeferredRestore` receives a state where the open tab groups from last session are stored in both `savedGroups` and `windows[].groups[]`. `_prepDataForDeferredRestore` has logic to convert the open tab groups in `windows[].groups[]` into saved groups, but it'll skip any that are already present in the list of saved groups. This was fine until the fix for bug 1954488, which unsets `removeAfterRestore` from the saved group; the `windows[].groups[]` groups get the `removeAfterRestore` flag set, but that does not get put into `savedGroups` because the group already exists in `savedGroups`.

I amended the logic so that when a group is in `windows[].groups[]` and `savedGroups`, the tab group state from `savedGroups` will get `removeAfterRestore` set back to true.

Not totally sure why I could reproduce this on Windows but not on macOS. It looks like the saved groups in `defaultState.savedGroups` still have `removeAfterRestore: true` set even after the `delete group.removeAfterRestore`. I don't understand how that would happen.

Differential Revision: https://phabricator.services.mozilla.com/D246377
2025-04-24 01:44:21 +00:00
..