Skip to content

Bug 2026616 - Fix session loss on browser restart#1156

Draft
jporter-dev wants to merge 1 commit into
mozilla:enterprise-mainfrom
jporter-dev:enterprise-bug2026616-felt-restart-session-race
Draft

Bug 2026616 - Fix session loss on browser restart#1156
jporter-dev wants to merge 1 commit into
mozilla:enterprise-mainfrom
jporter-dev:enterprise-bug2026616-felt-restart-session-race

Conversation

@jporter-dev

@jporter-dev jporter-dev commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Description

Bugzilla: Bug-2026616

When a FELT-managed browser requests a restart, FeltProcessParent force-kills the browser process immediately and then relaunches it. This races the browser's shutdown before its session store has flushed to disk, so the relaunch comes up looking like a crash instead of restoring the previous session.


Testing

  • Added tests
  • Manual testing performed

Steps to verify changes:

  1. In about:preferences, ensure "Open previous windows and tabs" is unchecked
  2. Start the FELT browser and open a few tabs
  3. Trigger a restart
    • Navigate to about:profiles and click "Restart Normally"
    • In the browser console:
      Services.startup.quit(Ci.nsIAppStartup.eRestart | Ci.nsIAppStartup.eAttemptQuit);
    • In the browser console: Services.obs.notifyObservers(null, "felt-update-ready");, then click "Update Available - Restart Now"
  4. Wait for the browser to reopen

Expected result:

The browser exits cleanly and relaunches once, with the previous session/tabs restored.

@jporter-dev jporter-dev self-assigned this Jul 15, 2026
@jporter-dev jporter-dev added bug Something isn't working branch:main PR that should be merged on enterprise-main branch labels Jul 15, 2026
@jporter-dev
jporter-dev force-pushed the enterprise-bug2026616-felt-restart-session-race branch 5 times, most recently from 63e479b to 1cc92e3 Compare July 17, 2026 15:46
@jporter-dev jporter-dev changed the title Bug 2026616 - Wait for the FELT browser to exit before relaunching on restart Bug 2026616 - Fix session loss on browser restart Jul 17, 2026
@jporter-dev
jporter-dev force-pushed the enterprise-bug2026616-felt-restart-session-race branch from 1cc92e3 to 0222422 Compare July 17, 2026 21:31
Comment on lines +319 to +323
* Stops the current browser for a restart once it has persisted its session.
* We wait for the browser's felt-firefox-session-flushed signal (with a
* bounded fallback) rather than a full clean shutdown, which can hang, then
* stop the process so the relaunch is deterministic and the session is never
* lost. Resolves once the stopped process has been reaped.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That comment makes me worried: why would a full clean shutdown hang? There are no good reason.

@jporter-dev
jporter-dev force-pushed the enterprise-bug2026616-felt-restart-session-race branch 2 times, most recently from 65008a0 to ed03007 Compare July 17, 2026 22:46
@jporter-dev
jporter-dev force-pushed the enterprise-bug2026616-felt-restart-session-race branch from ed03007 to 98bb638 Compare July 18, 2026 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

branch:main PR that should be merged on enterprise-main branch bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants