"Open on last tab" opens another about:home when "Homepage as a new tab" is enabled and about:home is the last tab on screen when you close Firefox
Categories
(Firefox for Android :: Homepage, defect)
Tracking
()
People
(Reporter: amirms76, Unassigned)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: regression, Whiteboard: [fxdroid] [group5])
Steps to reproduce
- Enable "Last tab" under Settings > Homepage > Opening screen
- Enable "Homepage as a New Tab" in secret settings
- Close all tabs (for convenience). Open a new tab. It opens about:home & the number of opens tabs is 1.
- Close Firefox while being on this tab by selecting Quit in the menu or discarding it in Android recent apps.
- Open Firefox again.
Actual results
It opens a new about:home & now there are 2 tabs opened.
Expected results
A new about:home should not open. Instead, Firefox should start on the existing about:home and the number of tabs should stay 1, not 2.
Comment 1•1 month ago
|
||
| frontend-triage | ||
This is caused by the cold-start branch added in bug 2072356, combined with the "Last tab" behaviour from bug 2042934. In "Last tab" mode, Settings.shouldStartOnHome() in Settings.kt returns true when lastHomeActivity > lastBrowseActivity. HomeFragment.kt records that timestamp, so the check passes whenever you leave Firefox from the homepage. On the next cold start, HomeActivity.kt then takes the shouldStartOnHome() && enableHomepageAsNewTab branch and calls addNewHomepageTab(). That branch was meant for the "Homepage" opening screen. With homepage-as-a-new-tab, the homepage you left is already a restored about:home tab, so you get a second one.
Fix: In HomeActivity.onCreate, never call addNewHomepageTab() when the opening screen is "Last tab" (settings.alwaysOpenTheLastTabWhenOpeningTheApp). With homepage-as-a-new-tab, the time check is not needed in "Last tab" mode: call navigateToBrowserOnColdStart() as with any other last tab. When the restored selected tab is about:home, AboutHomeBinding.kt already redirects BrowserFragment to home. The simpler alternative is to stay on the home screen, which navigateToHome() has already opened. But that would show home over a web tab if lastHomeActivity was last updated through one of the actionGlobalHome paths that this setting doesn't gate. HomepageTabBinding.kt still covers the case where no tabs are restored.
Nothing tests this branch yet. Add cases to HomeActivityTest.kt, and add a test for the lastHomeActivity > lastBrowseActivity branch in SettingsTest.kt. Bug 2080636 is the same symptom for the "Homepage" opening screen and goes through the same lines, so the two fixes should be coordinated.
Suggested severity: S3. Each relaunch from the homepage adds a redundant empty homepage tab for users of the Nightly-only "Homepage as a new tab" setting with "Last tab"; no data is lost and closing the extra tab works around it.
If you'd like to provide feedback on this comment, please use the 👍 or 👎 reaction.
If you want to categorize your feedback you can add one of the following tags: ai-triage-{wrong-file, wrong-cause, hallucination, out-of-scope, not-a-bug, wrong-fix, shallow-fix, wrong-severity}.
Needinfo hackbot@mozilla.tld to have a patch generated for this bug, include any questions or directions as needed in your comment.
Comment 2•1 month ago
|
||
Setting Bug 2072356 as the regressor for now
Comment 3•1 month ago
|
||
:npoon, since you are the author of the regressor, bug 2072356, could you take a look? Also, could you set the severity field?
For more information, please visit BugBot documentation.
Comment 4•1 month ago
|
||
I can confirm that the bug is reproducible. The regressor is likely correct. I'll add it to the homepage as new tab meta
Updated•1 month ago
|
Updated•1 month ago
|
Comment 5•1 month ago
|
||
Pref: homepage-as-new-tab
Comment 6•1 month ago
|
||
Set release status flags based on info from the regressing bug 2072356
Updated•1 month ago
|
Description
•