PS bid caching failures - #943
Open
mdanylov-sigma wants to merge 4 commits into
Open
mdanylov-sigma wants to merge 4 commits into
mdanylov-sigma wants to merge 4 commits into
Conversation
ValentinPostindustria
requested changes
May 20, 2026
mdanylov-sigma
force-pushed
the
feature/1258-cache-bid-failures
branch
from
July 3, 2026 12:34
54281ec to
b8e0080
Compare
Brings Android in line with the approved design doc for prebid/prebid-mobile-ios#1258 and the iOS implementation in prebid/prebid-mobile-ios#1327. - Rename PrebidMobile.setRequireServerSideBidCache to setFilterOutUncachedBids and give it a single responsibility: it only filters which bids reach the ad server and never requests caching. Prebid.java no longer adds the cache request for it, since Original API already asks Prebid Server to cache bids. - Scope the filtering and its result codes to Original API ad units. The Rendering API renders from the bid markup and never reads Prebid Cache, so a cache failure there is not a demand failure. - Require cacheId for a successful cache entry (bids or vastXml). Prebid Cache is read with GET /cache?uuid=<cacheId> and PUC builds that request from hb_cache_id. url is only cacheId joined with the cache host and path. - Keep filtering at parse time (Seatbid.BidFilter) so bid lists are not rebuilt, and drop seatbids left without bids. - Promote the highest-priced cached bid when the bid Prebid Server designated as the winner is filtered out. Previously all remaining cached demand was discarded. The result stays SUCCESS and BidInfo.isTopBidFiltered() reports the promotion for yield tracking. - BidLoader logs removed and promoted bids, returns NO_CACHED_BIDS when every bid was filtered and NO_BIDS otherwise, and still notifies the event delegate on that path, matching iOS. - Add the GAM (Original API) Display Banner 320x50 [Filter Uncached Bids] example to the Kotlin demo. Also restores BannerViewTest and InterstitialAdUnitTest to master.
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.
Handles Prebid Server bid caching failures for prebid/prebid-mobile-ios#1258, aligned with the reviewed design doc and the iOS implementation in prebid/prebid-mobile-ios#1327.
Changes
PrebidMobile.setFilterOutUncachedBids(boolean)(defaultfalse). It only filters which bids reach the ad server and never requests caching on its own. Original API already asks Prebid Server to cache bids, so the request builder is unchanged.ext.prebid.cache.bidsorext.prebid.cache.vastXmlhas acacheId. Prebid Cache is read withGET /cache?uuid=<cacheId>and Prebid Universal Creative builds that request fromhb_cache_id.urlis justcacheIdjoined with the cache host and path, so it never counts on its own.Seatbid.BidFilter), so bid lists are not rebuilt afterwards. Seatbids left without bids are dropped.hb_pb+hb_bidder) is filtered out, the highest-priced cached bid is promoted instead of discarding all remaining demand. The result staysResultCode.SUCCESS, and the newBidInfo.isTopBidFiltered()reports the promotion for yield tracking.ResultCode.NO_CACHED_BIDS(FetchDemandResult.NO_CACHED_BIDSfor mediation). A response that has no winner for any other reason still returnsNO_BIDS.BidLoaderlogs how many bids were removed and when a bid was promoted, and still notifiesPrebidEventDelegatewith the server response when all bids are filtered.Usage
Notes
hb_pb_appnexus), since the unsuffixed keys belonged to the filtered winner. Line items that target only the unsuffixedhb_pbwill not match it. iOS behaves the same way.Testing
BidResponseTest: filtering, winner promotion,urlwithoutcacheId, Rendering API not filtered, flag disabled.CacheTest:cacheId-only predicate,vastXmland lowercasevastxml.BidLoaderTest:NO_CACHED_BIDSvsNO_BIDS, promoted winner, Rendering API, event delegate.PrebidTest: the flag does not add a cache request../gradlew :PrebidMobile-core:testReleaseUnitTest: 1318 passed, 0 failed. Kotlin demo compiles.