Skip to content

Keep failure BidInfo free of an earlier bid - #1048

Merged
mdanylov-sigma merged 1 commit into
masterfrom
fix/bidinfo-native-cache-and-request-id
Nov 30, 2026
Merged

mdanylov-sigma merged 1 commit into
masterfrom
fix/bidinfo-native-cache-and-request-id

Conversation

@mdanylov-sigma

@mdanylov-sigma mdanylov-sigma commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #1035, from the review of #1047.

Changes

  • No earlier bid in a failure result. AdUnit kept the previous response until the next network callback, so a fetch that failed validation (no network, empty account id, invalid size) returned the earlier response's keywords, price and request id with the failure code. fetchDemand(Object, OnCompleteListener) now clears it first. The OnCompleteListener callbacks don't read that response, so they are unchanged.
  • getRequestId() doc. It said the id is set whenever a response was received, but NO_BIDS and NO_CACHED_BIDS are reported without the response, including a parsed one that filterOutUncachedBids emptied. The doc now says it is set for SUCCESS (even with no designated bid) and null for any other result. The Mediation API passes the response only with SUCCESS, so the same holds there.

This branch also fixed the native bid being saved to CacheManager twice. #1047 landed its own fix for that (NativeAdUnit.createBidInfo passes the listener's cache id to BidInfo.create), with tests, so that part was dropped when rebasing onto master.

Test plan

  • Two new AdUnitTest cases check that a validation failure after an earlier response reports only the result code, through fetchDemandBidInfo and fetchDemand(OnFetchDemandResult). Both fail without the AdUnit change (they get the earlier keywords) and pass with it, re-checked on the rebased branch.
  • :PrebidMobile-core:testDebugUnitTest locally on the rebased branch: 1585 tests. The 3 failures also fail on master at 18e416d (MraidInternalBrowserActionTest.handleInternalBrowserActionFollowUrlSuccessAndIsMraid_StartActionViewActivity, InterstitialAdUnitTest.onPrebidSdkWin_serverIsMuted_rendersFromAMutedCopyAndKeepsTheAdUnitUnmuted, RewardedAdUnitTest.onPrebidSdkWin_rendersFromACopyThatSharesTheAdUnitRewardManager).

🤖 Generated with Claude Code

@mdanylov-sigma
mdanylov-sigma force-pushed the fix/bidinfo-native-cache-and-request-id branch from 7b2ddf4 to e7bd2db Compare November 14, 2026 22:59
@mdanylov-sigma mdanylov-sigma changed the title Cache the native bid once and keep failure BidInfo free of an earlier bid Keep failure BidInfo free of an earlier bid Nov 14, 2026
@YuriyVelichkoPI YuriyVelichkoPI added this to the 3.5.0 milestone Nov 29, 2026

@YuriyVelichkoPI YuriyVelichkoPI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

- AdUnit kept the previous response until the next network callback, so a
  fetch that failed validation (no network, empty account id) returned the
  earlier response's keywords, price and request id with the failure code.
  fetchDemand now clears it first.
- BidInfo.getRequestId documented the id as set whenever a response was
  received, but NO_BIDS and NO_CACHED_BIDS are reported without the
  response, including a parsed one that filterOutUncachedBids emptied. The
  doc now states it is set for SUCCESS and null otherwise.

Follow-up to #1035. The native double cache save this branch also fixed
landed on master with #1047.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mdanylov-sigma
mdanylov-sigma force-pushed the fix/bidinfo-native-cache-and-request-id branch from e7bd2db to cbb5fd6 Compare November 30, 2026 11:55
@mdanylov-sigma
mdanylov-sigma merged commit 6a84492 into master Nov 30, 2026
6 checks passed
@mdanylov-sigma
mdanylov-sigma deleted the fix/bidinfo-native-cache-and-request-id branch November 30, 2026 17:09
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.

2 participants