Bug: [Intermittent] The Shortcuts and Recommended by Pocket sections are gone at browser restart if the session restore is not enabled on Nightly
Status: VERIFIED
Priority: --
Resolution: FIXED
Created: 2023-03-22 09:51:45+00:00
Resolved: 2023-04-20 15:04:25+00:00

**[Notes]:**
- I was not able to reproduce this issue on Firefox Beta 112.0b4 (Build ID - 20230319180129) using multiple new profiles which I restarted and reopened several times.
- I am not able to find a regression range due to the fact that each time a build is open through the program, it resets the “Nightly Data Collection and Use” options from `about:preferences#privacy`. Because of this, I get unenrolled from the experiment and can’t reproduce the issue.
- I tried the STR using an older Nightly build 112.0a1 (Feb. 25) and the issue is also reproducible there.

**[Affected versions]:**
- Firefox Nightly 113.0a1 - Build ID: 20230321091911
- Firefox Nightly 112.0a1 - Build ID: 20230225205757

**[Affected Platforms]:**
- Windows 10 x64
- macOS 12.4
- Linux Ubuntu 20.04 x64

**[Prerequisites]:**
- Have a VPN client connected to an US server (for people located outside the US).
- Have the `nimbus.debug` pref set to `true`.
- Session restore is not enabled.

**[Steps to reproduce]:**
1. Open the browser from the prerequisites.
2. Copy and paste the following link in a new tab: 
`about:studies?optin_slug=showing-3rd-sponsored-tile-on-the-newtab-page&optin_branch=treatment&optin_collection=nimbus-preview`
4. Open a new tab and make sure there are 3 sponsored tiles.
5. Close the browser.
6. Open the browser and observe the behavior.

**[Expected result]:**
- All the elements from the new tab are displayed: the web Search bar, the Shortcuts and the Recommended by Pocket sections.

**[Actual result]:**
- Only the web Search bar remains displayed, the Shortcuts and the Recommended by Pocket sections are gone.

**[Additional Notes]:**
- The issue is cleared when refreshing the affected tab and is no longer reproducible when opening a new tab.
- Both the Shortcuts and Recommended by Pocket sections are enabled in the `about:preferences#home` and “Personalize new tab” menu when reproducing the issue.
- The issue is not reproducible with session restore enabled.
- The issue is reproducible only when enrolled in the experiment and it happens across all 3 branches (1,2, and 3 sponsored tiles)
- Not sure if related to the issue, but after restarting the browser and reproducing the issue, I noticed the following errors in the Browser Console:
`While creating services from category 'profile-after-change', service for entry 'URLQueryStringStripper', contract ID '@mozilla.org/url-query-string-stripper;1' does not implement nsIObserver.`
`NS_ERROR_NOT_IMPLEMENTED: Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIAppStartup.secondsSinceLastOSRestart]
    _collectStartupConditionsTelemetry resource:///modules/BrowserGlue.sys.mjs:1598
    BG__onFirstWindowLoaded resource:///modules/BrowserGlue.sys.mjs:1704
    BG_observe resource:///modules/BrowserGlue.sys.mjs:951
    _delayedStartup chrome://browser/content/browser.js:2067
BrowserGlue.sys.mjs:1607:15
    _collectStartupConditionsTelemetry resource:///modules/BrowserGlue.sys.mjs:1607
    BG__onFirstWindowLoaded resource:///modules/BrowserGlue.sys.mjs:1704
    BG_observe resource:///modules/BrowserGlue.sys.mjs:951
    _delayedStartup chrome://browser/content/browser.js:2067`
- [Here](https://drive.google.com/file/d/1Rh1XLalst7aFJxkfPyqdztxpkvpAIHea/view?usp=sharing) is a screen recording of the issue.