Closed Bug 1492454 Opened 3 years ago Closed 3 years ago

The "CFR Recommendation" is wrongly displayed more than once during a day, if the browser is restarted


(Firefox :: Messaging System, defect, P1)




Firefox 64
64.2 - Sep 28
Tracking Status
firefox-esr60 --- unaffected
firefox62 --- unaffected
firefox63 + verified
firefox64 --- verified


(Reporter: mcoman, Assigned: k88hudson)


(Blocks 1 open bug)



(3 files)

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

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

- Have a Firefox profile with the following prefs in the "about:config" page:
	- "browser.newtabpage.activity-stream.asrouterExperimentEnabled" with "true" value;
	- "browser.newtabpage.activity-stream.asrouter.messageProviders" with "[{"id":"cfr", "cohort": "one_per_day", "frequency": {"custom": [{"period": "daily", "cap": 1}]}, "type":"local","localProvider":"CFRMessageProvider","enabled":true}]" value.
	- "" set to "US";
	- "" set to true.
	- Have two "Top Sites" with the "frecency" score at least 10000 (eg. "YouTube" and "Wikipedia").
- 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 first "Top Site" from prerequisites.
3. Restart the browser.
4. Open another tab and click the second "Top Site" from prerequisites.
5. Observe the right part of the "Address Bar".

[Expected result]:
- Only the "Page actions", "Save to Pocket" and "Bookmark this page" buttons are displayed.

[Actual result]:
- The "CFR Recommendation" button is also displayed.

- The "frecency" score is determined by the number of times a website is accessed. If a website is accessed for multiple times will result a higher "frecency" score. Also, it can be verified by typing the following string in the Browser Console: NewTabUtils.activityStreamProvider.getTopFrecentSites({numItems: 25}).then(r => console.log(>`${s.url} [${s.frecency}]`).join('\n'))) .
- This issue is reproducible on all the study's branches.
- Attached a screen recording of the issue.
Closed: 3 years ago
Resolution: --- → FIXED
[Tracking Requested - why for this release]: This is a severe enough bug that users would be getting too many recommendations; we will need to uplift this fix.
Iteration: --- → 64.2 (Sep 28)
Priority: -- → P1
Resolution: FIXED → ---
Blocks: 1491379
Tracking as this is blocking a shield study. Please get a patch reviewed, landed and sticking on mozilla-central and then request an uplift of the patch to beta branch thanks.
Comment on attachment 9011056 [details]
Bug 1492454 - Normalise ASRouter frequency caps

Ursula Sarracini (:ursula) has approved the revision.
Attachment #9011056 - Flags: review+
Pushed by
Normalise ASRouter frequency caps r=ursula
Closed: 3 years ago3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 64
Assignee: nobody → khudson
Comment on attachment 9011056 [details]
Bug 1492454 - Normalise ASRouter frequency caps

Approval Request Comment
[Feature/Bug causing the regression]: Daily contextual feature recommendation impressions are cleared when the browser restarts, invalidating daily frequency caps
[User impact if declined]: Users will see too many recommendations in one day, potentially causing too much disruption/annoyance
[Is this code covered by automated tests?]: Yes
[Has the fix been verified in Nightly?]: On nightly as of Sept. 22 
[Needs manual test from QE? If yes, steps to reproduce]: STR is included in the first comment of this bug
[List of other uplifts needed for the feature/fix]: None
[Is the change risky?]: No
[Why is the change risky/not risky?]: The change affects code only running behind a pref/during a study
[String changes made/needed]: None
Attachment #9011056 - Flags: approval-mozilla-beta?
Comment on attachment 9011056 [details]
Bug 1492454 - Normalise ASRouter frequency caps

Thanks, uplift approved for 63 beta 9.
Attachment #9011056 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
I have verified that this issue is no longer reproducible on Windows 10 x64, Arch Linux and Mac 10.13.3 with the latest version of Firefox Beta (63.0b9 - Build ID 20180924202103) and latest "Firefox Nightly" (64.0a1 - Build ID 20180924220042) installed. Now the "CFR Recommendations" are displayed only once in a day.
Component: Activity Streams: Newtab → Messaging System
You need to log in before you can comment on or make changes to this bug.