Open Bug 2072353 Opened 2 months ago Updated 1 month ago

[HNT] Opening about:home bookmark doesn't work

Categories

(Firefox for Android :: Homepage, defect)

All
Android
defect

Tracking

()

People

(Reporter: npoon, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxdroid] [group5])

Steps to reproduce

  1. Have a bookmark for about:home
  2. Open a homepage tab
  3. Go to bookmarks and click on the about:home bookmark

Expected behavior

We navigate to a new homepage tab

Actual behavior

We are stuck in a loading state

Any additional information?

This probably has to do with our AppRequestInterceptor and how we don't navigate on the HomeFragment. My guess is that about:home brings up the HomeFragment and the interceptor doesn't navigate when it should in this case

No longer depends on: homepage-as-new-tab
Summary: [HNT} Opening about:home bookmark doesn't work → [HNT] Opening about:home bookmark doesn't work

BookmarksMiddleware.kt handles BookmarkClicked by loading the URL and then unconditionally calling navigateToBrowser(), which is navController.navigate(R.id.browserFragment) in BookmarkFragment.kt, so an about:home bookmark ends up on BrowserFragment showing a blank document on top of whatever interceptAboutHomeRequest in AppRequestInterceptor.kt navigated to. Nothing recovers when the selected tab is already the homepage tab: AboutHomeBinding.kt is gated on distinctUntilChanged() of the selected tab's URL, which does not change, and if that tab has no engine session LinkingMiddleware.kt adds LOAD_FLAGS_BYPASS_LOAD_URI_DELEGATE for ABOUT_HOME_URL, so the interceptor never runs.

Fix: Handle the homepage explicitly in BookmarksMiddleware instead of relying on the interceptor side effect: when the clicked bookmark normalizes to ABOUT_HOME_URL, call FenixBrowserUseCases.navigateToHomepage() and navigate via NavGraphDirections.actionGlobalHome() rather than navigateToBrowser(), wiring the new callback through BookmarkFragment.kt and EditBookmarkFragment.kt, which shares the same construction. Cover it with an about:home BookmarkClicked case in BookmarksMiddlewareTest.kt asserting the home destination.

Suggested severity: S3. A homepage bookmark leaves the user on a blank browser page instead of the homepage, but the feature is off outside Nightly and tapping the home button or opening a new 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, 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.

You need to log in before you can comment on or make changes to this bug.