Bug 1874114 Comment 4 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

To confirm, I can reproduce this. 
- Using build prior to bug 1864534, open several tabs, including one at "about:firefoxview-next". 
- Check the "Open previous windows and tabs" option in about:preferences
- Close the browser
- Update to latest nightly (Note this may get fixed by bug 1874253, so you'll need a build from before any patch on that bug lands.)

ER: 
- All the previously open tabs should be restored. As "about:firefoxview-next" is no longer a valid about: URL, we'd expect a "That address doesn’t look right" error page

AR: 
- Tabs do not get restored. 
- An exception is logged: `JavaScript error: resource://gre/modules/E10SUtils.sys.mjs, line 435: NS_ERROR_ILLEGAL_VALUE: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIAboutModule.getURIFlags]`

That exception comes from [E10SUtils.sys.mjs](https://searchfox.org/mozilla-central/rev/961a9e56a0b5fa96ceef22c61c5e75fb6ba53395/toolkit/modules/E10SUtils.sys.mjs#427-435), the stack trace looks like: 

```
getRemoteTypeForURIObject@resource://gre/modules/E10SUtils.sys.mjs:435:26
getRemoteTypeForURI@resource://gre/modules/E10SUtils.sys.mjs:384:17
createTabsForSessionRestore@chrome://browser/content/tabbrowser.js:3167:47
ssi_restoreWindow@resource:///modules/sessionstore/SessionStore.sys.mjs:5071:29
_restoreWindowsFeaturesAndTabs@resource:///modules/sessionstore/SessionStore.sys.mjs:5245:12
_restoreWindowsInReversedZOrder@resource:///modules/sessionstore/SessionStore.sys.mjs:5269:10
ssi_restoreWindows/<@resource:///modules/sessionstore/SessionStore.sys.mjs:5340:12
```

`createTabsForSessionRestore` builds a document fragment with all of the tabs to be restored. When the call to `E10SUtils.getRemoteTypeForURI` throws an exception, we bail out of the loop and restore none of the tabs. 

This particular case with the partly-removed about: page has a root cause we can fix elsewhere, but it seems likely there are other spots in this same block where unexpected tab data might result in an exception, and we should be able to catch those and continue restoring all the other tabs.
To confirm, I can reproduce this. 
- Using build prior to bug 1864534, open several tabs, including one at "about:firefoxview-next". 
- Check the "Open previous windows and tabs" option in about:preferences
- Close the browser
- Update to latest nightly (Note this may get fixed by bug 1874253, so you'll need a build from before any patch on that bug lands.)

ER: 
- All the previously open tabs should be restored. As "about:firefoxview-next" is no longer a valid about: URL, we'd expect a "That address doesn’t look right" error page (covered by 1874253), or, failing that it just loads about:blank.
AR: 
- Tabs do not get restored. 
- An exception is logged: `JavaScript error: resource://gre/modules/E10SUtils.sys.mjs, line 435: NS_ERROR_ILLEGAL_VALUE: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIAboutModule.getURIFlags]`

That exception comes from [E10SUtils.sys.mjs](https://searchfox.org/mozilla-central/rev/961a9e56a0b5fa96ceef22c61c5e75fb6ba53395/toolkit/modules/E10SUtils.sys.mjs#427-435), the stack trace looks like: 

```
getRemoteTypeForURIObject@resource://gre/modules/E10SUtils.sys.mjs:435:26
getRemoteTypeForURI@resource://gre/modules/E10SUtils.sys.mjs:384:17
createTabsForSessionRestore@chrome://browser/content/tabbrowser.js:3167:47
ssi_restoreWindow@resource:///modules/sessionstore/SessionStore.sys.mjs:5071:29
_restoreWindowsFeaturesAndTabs@resource:///modules/sessionstore/SessionStore.sys.mjs:5245:12
_restoreWindowsInReversedZOrder@resource:///modules/sessionstore/SessionStore.sys.mjs:5269:10
ssi_restoreWindows/<@resource:///modules/sessionstore/SessionStore.sys.mjs:5340:12
```

`createTabsForSessionRestore` builds a document fragment with all of the tabs to be restored. When the call to `E10SUtils.getRemoteTypeForURI` throws an exception, we bail out of the loop and restore none of the tabs. 

This particular case with the partly-removed about: page has a root cause we can fix elsewhere, but it seems likely there are other spots in this same block where unexpected tab data might result in an exception, and we should be able to catch those and continue restoring all the other tabs.

Back to Bug 1874114 Comment 4