refactor(ads-client): unified ads type - #7629
Merged
Merged
Conversation
…AC-188)
The ad store kept one ad per placement in StorableAd, and the request
queue landed its own Ads enum for fetch_ads_mixed, so the crate had
three ways to hold a placement's ads. There is now one:
pub enum Ads {
Images(Vec<AdImage>),
Spocs(Vec<AdSpoc>),
Tiles(Vec<AdTile>),
}
- The store's store_ad and lookup take and return Ads, so a placement
keeps every ad it was served.
- fetch_ads_mixed returns HashMap<PlacementId, Ads>, ready to store.
- ads.rs holds Ads, PlacementId and the ad structs (AdImage, AdSpoc,
AdTile and their callback, cap and ranking fields), moved out of
mars/ad_response.rs and ads_store.rs. It is always compiled because
the legacy path uses the structs; Ads and PlacementId stay behind the
stateful feature.
- Store tests reuse the shared image and spoc fixtures from test_utils.
Almaju
force-pushed
the
AC-188-ads-type
branch
from
September 25, 2026 16:14
5d21980 to
210ce42
Compare
thesuzerain
approved these changes
Sep 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Create some Ads type to encapsulate both types from MARS and AdsStore.
Pull Request checklist
[ci full]to the PR title.