Closed Bug 1930653 Opened 9 months ago Closed 9 months ago

Newtab unified ads API isn't correctly handling a dismissed topsite ad

Categories

(Firefox :: New Tab Page, defect)

defect

Tracking

()

VERIFIED FIXED
134 Branch
Tracking Status
firefox133 --- verified
firefox134 --- verified

People

(Reporter: thecount, Assigned: thecount)

References

Details

(Whiteboard: [hnt])

Attachments

(2 files)

Topsites unified ads API client integration assumes an item is going to be returned in every spot, and this isn't always going to be true.

In the cases where it doesn't return an ad for any of the 3 spots, we get a js error, which is caught, but the code that finishes updating the topsite ads doesn't complete and ads don't display.

Dismiss is an easy way to test this, but it could happen for multiple reasons and the client should protect against this.

Assignee: nobody → sdowne
Status: NEW → ASSIGNED
Attachment #9436969 - Flags: approval-mozilla-beta?

beta Uplift Approval Request

  • User impact if declined: Impact to a rollout happening in 132
  • Code covered by automated testing: yes
  • Fix verified in Nightly: no
  • Needs manual QE test: yes
  • Steps to reproduce for manual QE testing: Steps to test in original phabricator link.
  • Risk associated with taking this patch: Low
  • Explanation of risk level: It's 1 if statement in a rollout that we have the ability to turn off, it's otherwise preffed off until we turn it on
  • String changes made/needed: None
  • Is Android affected?: no
Flags: qe-verify+
Pushed by nfay@mozilla.com: https://hg.mozilla.org/mozilla-central/rev/a65e1fdcde56 Fixing newtab unified ads API client integration for dismissed topsite ads. r=home-newtab-reviewers,nbarrett
Status: ASSIGNED → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → 134 Branch
Attachment #9436969 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [qa-triaged]

Tried to reproduced on Firefox Nightly from 2025.11.12 (Fx 134.0a1) with the following steps:

  1. Set "browser.newtabpage.activity-stream.unifiedAds.tiles.enabled" to true
  2. Turn sponsored topsites off and on.
  3. Dismiss a sponsored topsite.
  4. Turn sponsored topsites off and on again.
    Results was: a new topsite is added each time, so 3 are always visible. Repeated this for 10 time, after that topsites are gone, they don't appear at all, at least for a while.
    Tested on Firefox 137.0.2 and on 138.0b8, encountered the same behavior. I'm not sure if this is the expected behavior.
    @Scott can you please confirm that, what I tested is correct and the behavior is the expected one?
Flags: needinfo?(sdowne)

Yeah that's expected.

My steps to test in the original phabricator were a bit confusing, I should have said this:

"Expected: Should see at least 2 sponsored topsites you did not dismiss, and the one you did dismiss should still be gone."

The addition was "Should see at least 2 sponsored topsites ", and the important part that we were testing is "the one you did dismiss should still be gone".

So as long as the one you dismissed is still gone, and you saw some sponsored topsites still, you should be good.

Flags: needinfo?(sdowne)

Oh also "Repeated this for 10 time, after that topsites are gone, they don't appear at all, at least for a while."

That also makes sense. Eventually you would go through all the inventory and there would be nothing left, whatever the inventory is for your region in that moment.

Based on Scott's comment 8, mark the issue status as verified.

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

Attachment

General

Created:
Updated:
Size: