Open Bug 1489539 Opened Last year Updated Last year

The "frecency" score is wrongly counted for the redirected "Amazon" website if it is accessed with typed "@amazon" search alias

Categories

(Firefox :: Address Bar, defect, P2)

Unspecified
All
defect

Tracking

()

Tracking Status
firefox-esr60 --- unaffected
firefox62 --- unaffected
firefox63 --- affected
firefox64 --- affected

People

(Reporter: mcoman, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxsearch])

Attachments

(1 file)

Attached image rec of the issue.gif
[Affected versions]:
- Firefox 63 and above

[Affected Platforms]:
- All Windows
- All Linux
- All Mac

[Prerequisites]:
- Have a Firefox profile with the following prefs in the "about:config" page:
	- "browser.newtabpage.activity-stream.asrouterExperimentEnabled" with "true" value;
	- "browser.search.region" with "US" value.
	-  "devtools.chrome.enabled" on true.
- Have the "Browser Console" opened.

[Steps to reproduce]:
1. Open the browser with the profile from prerequisites.
2. Open a new tab and click the "Amazon" Top Site.
3. Repeat step 2 another four times and focus the "Browser Console".
4. Enter the following string in the console: "NewTabUtils.activityStreamProvider.getTopFrecentSites({numItems: 25}).then(r => console.log(r.map(s=>`${s.url} [${s.frecency}]`).join('\n')))".
5. Observe the displayed "frecency".

[Expected result]:
- The "frecency" score is "10000".

[Actual result]:
- The "frecency" score is "250".

[Notes]:
- This issue is not reproducible with the other "Top Sites" or "Search Shortcuts".
- Attached a screen recording of the issue.
These aren't visits to amazon top site. They're empty searches with @amazon. The 250 frecency matches up with 5 visits of 50 frecency.. probably from the amazon redirect.

Other searches that don't redirect correct get the 2000 typed frecency bonus.

Here's 3 visits to "@amazon":

sqlite> SELECT url, frecency, visit_count, typed, hidden FROM moz_places WHERE url LIKE '%amazon%';
https://www.amazon.com/exec/obidos/external-search/?field-keywords=&ie=UTF-8&mode=blended&tag=mozilla-20&sourceid=Mozilla-search|75|3|1|1
https://www.amazon.com/s?ie=UTF8&field-keywords=&index=blended&link_code=qs&sourceid=Mozilla-search&tag=mozilla-20|4025|3|0|1
https://www.amazon.com/ref=nb_sb_noss_null|150|3|0|0


The last page that top sites finds is the not-hidden 150 frecency.

Looks like there's two redirects. The intermediate redirect seems to get a typed bonus with 4025 frecency. Maybe the typed bonus should somehow be associated to the non-hidden url instead?
Component: Activity Streams: Newtab → Bookmarks & History
Summary: The "frecency" score is wrongly counted for the "Amazon" website if it is accessed from the "Tops Sites" area. → The "frecency" score is wrongly counted for the redirected "Amazon" website if it is accessed with typed "@amazon" search alias
Comment 1 reminds me a bit of bug 1332288 where docshell/http channels are telling us the wrong code for redirects and hence we get the frecency wrong.
Component: Bookmarks & History → Address Bar
Priority: -- → P2
Whiteboard: [fxsearch]
You need to log in before you can comment on or make changes to this bug.