Closed Bug 2052616 Opened 2 months ago Closed 2 months ago

Fetch New Tab ads through the MozAdsClient in AdsFeed

Categories

(Firefox :: New Tab Page, task)

task

Tracking

()

RESOLVED FIXED
154 Branch
Tracking Status
firefox154 --- fixed

People

(Reporter: ahanot, Assigned: ahanot)

References

Details

Attachments

(1 file, 1 obsolete file)

Wire the New Tab AdsFeed to fetch sponsored tiles and content through the MozAdsClient singleton (added in bug 2051420) when the AdsClient feature flag is enabled.

  • AdsFeed.fetchData gains an early guard: when the client is available it delegates to a new _fetchWithAdsClient; otherwise the existing legacy fetch runs unchanged.
  • _fetchWithAdsClient builds the placement requests and calls requestTileAds/requestSpocAds, sending them over the ads-client OHTTP viaduct channel via AdsClient.requestOptions().
  • AdsClient.sys.mjs gains the OHTTP configuration (requestOptions/configureOhttp); the New Tab request-building glue lives in AdsFeed so AdsClient stays the clean long-term interface.
  • For now the client results (canonical MozAdsTile/MozAdsSpoc) are mapped back to the existing snake_case shape the rest of New Tab consumes. Changing the consumers to the typed MozAds* shape touches too many files, so that is deferred to a follow-up; this keeps the diff small and the legacy path untouched.
  • Gated behind the AdsClient flag and unifiedAds.adsFeed.enabled (both off by default), so there is no shipped behavior change.

Wire AdsFeed to fetch sponsored tiles and content through the MozAdsClient
singleton (bug 2051420) when the AdsClient flag is enabled.

  • fetchData gains an early guard: when this.adsClient is set it delegates to a
    new _fetchWithAdsClient; otherwise the existing legacy fetch runs unchanged,
    so the legacy vs. ads-client paths stay clearly separated and legacy is easy
    to remove later.
  • _fetchWithAdsClient builds the placement requests and calls requestTileAds /
    requestSpocAds, sending them over the ads-client OHTTP viaduct channel via
    AdsClient.requestOptions().
  • AdsClient.sys.mjs keeps only the singleton and the reusable OHTTP config
    (requestOptions/configureOhttp); the New Tab request-building glue lives in
    AdsFeed so AdsClient stays the clean long-term interface.

The client returns the canonical MozAdsTile/MozAdsSpoc objects, but for now we
map them back to the existing snake_case shape the rest of New Tab consumes.
Switching the consumers to the typed MozAds* shape touches too many files, so
that is left for a follow-up; this keeps the diff small and the legacy path
untouched.

Gated behind the AdsClient flag and unifiedAds.adsFeed.enabled, both off by
default, so there is no shipped behavior change.

Assignee: nobody → ahanot
Status: NEW → ASSIGNED

Wire AdsFeed to fetch sponsored tiles and content through the MozAdsClient
singleton (bug 2051420) when the AdsClient flag is enabled.

  • fetchData gains an early guard: when this.adsClient is set it delegates to a
    new _fetchWithAdsClient; otherwise the existing legacy fetch runs unchanged,
    so the legacy vs. ads-client paths stay clearly separated and legacy is easy
    to remove later.
  • _fetchWithAdsClient builds the placement requests and calls requestTileAds /
    requestSpocAds, sending them over the ads-client OHTTP viaduct channel via
    AdsClient.requestOptions().
  • AdsClient.sys.mjs keeps only the singleton and the reusable OHTTP config
    (requestOptions/configureOhttp); the New Tab request-building glue lives in
    AdsFeed so AdsClient stays the clean long-term interface.
  • Expose the generated RustViaduct.sys.mjs bindings via MOZ_SRC_FILES so the
    OHTTP channel configuration (configureOhttpChannel/OhttpConfig) can be loaded.

The client returns the canonical MozAdsTile/MozAdsSpoc objects, but for now we
map them back to the existing snake_case shape the rest of New Tab consumes.
Switching the consumers to the typed MozAds* shape touches too many files, so
that is left for a follow-up; this keeps the diff small and the legacy path
untouched.

Gated behind the AdsClient flag and unifiedAds.adsFeed.enabled, both off by
default, so there is no shipped behavior change.

Attachment #9604393 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 154 Branch
QA Whiteboard: [qa-triage-done-c155/b154]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: