Closed Bug 2079704 Opened 1 month ago Closed 1 day ago

Sometimes doing a search from HNT does not load the target URL

Categories

(Firefox for Android :: Homepage, defect)

All
Android
defect

Tracking

()

RESOLVED DUPLICATE of bug 2095529
Tracking Status
firefox158 --- disabled
firefox159 --- disabled
firefox160 --- disabled
firefox161 --- disabled
firefox162 --- disabled

People

(Reporter: petru, Assigned: gl)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression, Whiteboard: [fxdroid] [group5])

Attachments

(1 file)

Attached video HNTNotLoadingUrls.mp4 —

Saw this happening intermittently if doing a new search from HNT after an application cold start.

Severity: -- → S3
Type: task → defect
Whiteboard: [fxdroid] [group5]
Keywords: regression
Regressed by: 2072356

Set release status flags based on info from the regressing bug 2072356

:npoon, since you are the author of the regressor, bug 2072356, could you take a look?

For more information, please visit BugBot documentation.

Flags: needinfo?(npoon)
Flags: needinfo?(npoon)

Set release status flags based on info from the regressing bug 2072356

Assignee: nobody → gl
Status: NEW → ASSIGNED

I have been having similar issues with tiles not loading intermittently

Set release status flags based on info from the regressing bug 2072356

Fixed by Bug 2095529, which changed which content process about:home loads in.

What was happening

On a cold start with "Opening screen: Homepage", Fenix adds a homepage tab (about:home). Bug 2072356 made this happen on every cold start, which is why this surfaced as a regression. Since Bug 2089622, the tab comes from FenixBrowserUseCases.selectOrAddHomepageTabAfterRestore(). LinkingMiddleware loads about:home into the tab's new engine session with LOAD_FLAGS_BYPASS_LOAD_URI_DELEGATE, and GeckoView queues that load until Gecko has finished starting. Because HNT loads the user's search into the same tab (newTab = false), the search becomes a second load on the same session.

On Android, the about:home redirector entry in nsAboutRedirector.cpp (added in bug 1962312, copied from Desktop) carried URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS. ProcessIsolation therefore sent every about:home load to the privilegedabout content process, which Android otherwise rarely uses, so it had to be launched cold, taking about 1.5 s. The search load reached Gecko while that process switch was still pending. Gecko aborted the about:home load (NS_BINDING_ABORTED) and started the search, but the pending about:home switch still completed, and its LocationChange about:home committed last. The tab's URL ended up back on about:home, which explains each symptom in the video:

  • The progress bar starts for the search, then stops when about:home commits.
  • The toolbar shows no URL, as it does for about:home.
  • The page is blank, because on Android about:home is only an empty about:blank placeholder.
  • AboutHomeBinding never brings up the native homepage, because from the store's point of view the URL never changed.

What fixed it

Bug 2095529 removed URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS from the Android about:home entry, so it now loads in a regular web content process with no process switch. about:home now commits about 80–265 ms after Gecko receives it instead of about 1.5 s, and the stale commit no longer happens.

Rare open cases

  1. Load ordering in android-components. If a load is issued while the homepage tab's engine session is still being created (roughly 0.2–0.7 s after the tab appears), it can reach the engine before LinkingMiddleware's about:home load, which is deferred with scope.launch. about:home then wins, and we get the same blank page. When the load is issued right after the homepage tab is created, and it doesn't depend on which process about:home loads in.
  2. Missing history entry. When the first load reaches Gecko before about:home commits, Gecko cancels about:home. The first page then has no homepage entry behind it, so Back/Forward can't reach the homepage.
Status: ASSIGNED → RESOLVED
Closed: 1 day ago
Duplicate of bug: 2095529
Resolution: --- → DUPLICATE

Nice sleuthing!

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

Attachment

General

Created:
Updated:
Size: