Skip to content

feat(ads-client): add OHTTP support (AC-94)#7315

Draft
Almaju wants to merge 1 commit intomozilla:mainfrom
Almaju:ac-94-ohttp-support
Draft

feat(ads-client): add OHTTP support (AC-94)#7315
Almaju wants to merge 1 commit intomozilla:mainfrom
Almaju:ac-94-ohttp-support

Conversation

@Almaju
Copy link
Copy Markdown
Contributor

@Almaju Almaju commented Apr 8, 2026

Summary

  • Add ohttp: bool field to MozAdsRequestOptions and new MozAdsCallbackOptions { ohttp: bool } to opt individual requests into OHTTP routing
  • Add OHTTP support to all MARS request paths: request_tile_ads, request_image_ads, request_spoc_ads, record_impression, record_click, report_ad
  • All new options parameters use UniFFI defaults so existing callers require no changes
  • Move OHTTP_CHANNEL_ID from http_cache into client — http_cache is now generic and has no ads-client knowledge
  • Add #[uniffi(default = None/false)] to optional fields across MozAdsPlacementRequest, MozAdsCacheConfig, MozAdsRequestCachePolicy for better ergonomics in consumer code
  • Split docs/usage.md into per-language files (usage-javascript.md, usage-kotlin.md, usage-swift.md) with correct language-specific examples
  • Add NSS build steps to CI workflow (required since viaduct's ohttp feature depends on NSS)
  • Add integration test test_contract_tile_ohttp_prod against production MARS over OHTTP

Pull Request checklist

  • Breaking changes: This PR follows our breaking change policy
    • This PR follows the breaking change policy:
      • This PR has no breaking API changes, or
      • There are corresponding PRs for our consumer applications that resolve the breaking changes and have been approved
  • Quality: This PR builds and tests run cleanly
    • Note:
      • For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
      • If this pull request includes a breaking change, consider cutting a new release after merging.
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry in CHANGELOG.md or an explanation of why it does not need one
    • Any breaking changes to Swift or Kotlin binding APIs are noted explicitly
  • Dependencies: This PR follows our dependency management guidelines
    • Any new dependencies are accompanied by a summary of the due diligence applied in selecting them.

@Almaju Almaju force-pushed the ac-94-ohttp-support branch 3 times, most recently from 5654d59 to b9cd744 Compare April 9, 2026 17:17
@Almaju Almaju marked this pull request as ready for review April 9, 2026 17:27
@Almaju Almaju force-pushed the ac-94-ohttp-support branch from e1f3556 to 0e85300 Compare April 9, 2026 17:32
@Almaju Almaju changed the title feat(ads-client): add OHTTP support via enable_ohttp() builder method feat(ads-client): add OHTTP support (AC-94) Apr 9, 2026
@Almaju Almaju marked this pull request as draft April 9, 2026 19:43
@Almaju Almaju force-pushed the ac-94-ohttp-support branch from cf209d8 to 2139dae Compare April 10, 2026 16:45
…lient

- ohttp_client is always initialized (no longer Option<Client>)
- fetch_ads, record_click, record_impression, report_ad all take ohttp: bool
  to select direct vs OHTTP transport per request
- HttpCache no longer owns a Client; send_with_policy/fetch_and_cache take
  &Client as first arg, removing the need for set_client
- enable_ohttp/disable_ohttp now only manage preflight (geo/UA headers)
- FFI methods default ohttp to false for backward compatibility
@Almaju Almaju force-pushed the ac-94-ohttp-support branch from 2139dae to e3f7000 Compare April 10, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant