[HNT] Toggling Private Browsing spawns multiple duplicate about:home tabs
Categories
(Firefox for Android :: Homepage, defect)
Tracking
()
People
(Reporter: breakingspell, Unassigned)
Details
Attachments
(1 file)
|
669.35 KB,
video/mp4
|
Details |
Steps to reproduce:
Install nightly or build latest main, enable Secret Settings -> "Homepage as a New Tab."
Toggle Private Browsing using the homepage button element, go back and forth a few times.
Actual results:
Notice that several about:home tabs have populated both lists, in both regular and Private mode. Entering/exiting the Private Tabs mode has the effect of spawning a duplicate tab each time.
Expected results:
If the last tab in the list is the homepage, a new, duplicate homepage tab should not be spawned, instead the existing homepage tab should be focused.
This might extend to cases where about:home is already somewhere in the list, not just the last position.
Comment 1•2 months ago
|
||
| frontend-triage | ||
PrivateBrowsingController.kt calls fenixBrowserUseCases.addNewHomepageTab(private = newMode.isPrivate) on every toggle while enableHomepageAsNewTab is set, and FenixBrowserUseCases.kt dispatches tabsUseCases.addTab with no lookup for an existing about:home tab, so each switch appends one more to the target mode's list. That call came from bug 1969252 (hg 3192711610d2) to guarantee a tab exists in the new mode, which HomepageTabBinding.kt already handles when that mode's tab list is empty.
Fix: Add a selectOrAddHomepageTab(private) use case that resolves findNormalOrPrivateTabByUrl(ABOUT_HOME_URL, private) and selects the hit, falling back to addNewHomepageTab when there is none, and call it from handlePrivateModeButtonClicked; extend DefaultPrivateBrowsingControllerTest.kt, which currently asserts only on a relaxed mock, to check against a real BrowserStore that a second toggle does not grow the tab list.
I triaged this from the description and the code and did not view the attached screen recording.
Suggested severity: S3. Repeated toggling accumulates unwanted tabs in both tab lists, but closing them works around it and the feature is behind a Nightly secret setting that is off by default.
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, ai-triage-wrong-cause, ai-triage-hallucination, ai-triage-out-of-scope, ai-triage-wrong-fix, ai-triage-shallow-fix.
Needinfo hackbot@mozilla.tld to have a patch generated for this bug, include any questions or directions as needed in your comment.
| Reporter | ||
Comment 2•2 months ago
|
||
The bot is onto something, the suggested fix (selectOrAddHomepageTab()) seems to work at first glance.
Waiting for maintainers though.
Comment 3•2 months ago
|
||
The severity field is not set for this bug.
:gl, could you have a look please?
For more information, please visit BugBot documentation.
Comment 4•2 months ago
|
||
Closing this as a dupe. Feel free to reopen if I've misunderstood
Description
•