Closed Bug 1812197 Opened 3 years ago Closed 3 years ago

Autofilling does not show the page title properly for some URLs

Categories

(Firefox :: Address Bar, defect)

defect

Tracking

()

VERIFIED FIXED
111 Branch
Tracking Status
firefox111 --- verified

People

(Reporter: daisuke, Assigned: daisuke)

Details

Attachments

(1 file)

This is reported in https://phabricator.services.mozilla.com/D157891#5517028.
Autofilling does not show the page title properly for some URLs even those that are in Places.
For example, in my env, autofilling did not show the title for reddit.com or youtube.com after visiting and bookmarking them. But, it did properly for example.com.
We need to investigate it.

I investigated this.
As the cause, when opening reddit.com, it will be redirected to https://www.reddit.com/.
In this case, the records for https://reddit.com/ and https://www.reddit.com/ will be inserted in moz_place, but the title of https://reddit.com/ will be null. Then, if autofilling with reddit.com, the record matched with it will be https://reddit.com/, so the result of null title will be shown. youtube.com is the same, it will be redirected to https://www.youtube.com/.

For examole, if we change the LFFT JOIN of SQL for origin to below, we can show the title. But I am not sure this is the right way.

LEFT JOIN moz_places h ON h.url_hash IN (
  hash('https://' || host_fixed),
  hash('https://www.' || host_fixed),
  hash('http://' || host_fixed),
  hash('http://www.' || host_fixed)
) AND h.title IS NOT NULL

I thought more right way is, when redirection, save the destination to moz_places, then refer to it. But, the SQL will be complex and might worse the performance. Oppositely, we might be able to update the title of source of redirection by destination’s title?
What do you think?

Flags: needinfo?(adw)

Thanks Daisuke, I have a few thoughts:

Your proposed query seems like the right approach to me. It's very similar to the approach we used for the new history URL heuristic provider.

You mentioned storing redirects in moz_places -- that might be one way to do it, and it also might help address other problems around redirects. We could also store titles directly in moz_origins. However, I don't think we need to make any schema changes to fix this bug. The join on moz_places should be O(1) since we can use url_hash, as in your proposed query.

Right now the origins query only returns one row, but the left join in your proposed query can cause it to return multiple rows. We'll need to be careful to produce a stable ordering of the rows and pick the top/best one (for some definition of "top") so that the same title is always returned for the same search string. We'll probably need to use an ordering similar to the one the new heuristic provider uses.

Flags: needinfo?(adw)

Thank you very much!
Okay, I will fix it by modifying the SQL.

Assignee: nobody → daisuke
Status: NEW → ASSIGNED
Pushed by dakatsuka.birchill@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/46dd2ea2ea5e Show page title by alternate same origin if matched origin has no title. r=adw
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch

I've managed to reproduce the issue using Fx111.0a1 (buildID 20230127094652).
The issue is verified fixed using the latest Fx111.0a1 on Windows 10 and Ubuntu 22. After bookmarking reddit.com and the autocomplete is done when trying to access it again, the page tittle is correctly displayed.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: