Register APS renderer via requestId so it survives Prebid field stripping#963
Open
aram356 wants to merge 2 commits into
Open
Register APS renderer via requestId so it survives Prebid field stripping#963aram356 wants to merge 2 commits into
aram356 wants to merge 2 commits into
Conversation
…ping APS bids are bid-by-reference: interpretResponse sets the renderer descriptor on the Prebid bid as the custom `trustedServerRenderer` field, and a bidResponse listener registers it in window.tsjs.apsPrebidRenderers keyed by Prebid's generated adId so the Universal Creative can later request it. Prebid normalizes each bid into its own object during addBidResponse and drops unknown top-level fields, so the custom field can be gone before the bidResponse listener runs (observed in production: absent as early as bidAccepted). The listener then saw renderer === undefined and returned without registering, leaving the registry empty; the Universal Creative's request found nothing and Prebid's default renderer threw "Missing ad markup or URL" (reason noAd) for every APS bid. Also stash the descriptor keyed by `requestId` (a first-class field Prebid preserves) when the bids are built, and have the bidResponse listener fall back to that stash when the custom field is absent. Additive: the existing field path is unchanged, so cases where the field survives behave exactly as before; the fallback engages only when Prebid has stripped it. Bounded map. Adds a unit test that registers via requestId with the custom field removed.
…aps-renderer-requestid-registration
4 tasks
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.
Fixes #962. Stacked on #918 (targets
issue-764-aps-openrtb).Problem
APS bid-by-reference renderers never register, so every APS bid renders empty and Prebid throws
Missing ad markup or URL(reasonnoAd).interpretResponsesets the renderer descriptor on the bid as the customtrustedServerRendererfield; thebidResponselistener registers it intowindow.tsjs.apsPrebidRendererskeyed by the generatedadId. But Prebid drops unknown top-level fields when it normalizes bids duringaddBidResponse, so the custom field is gone before the listener runs (absent as early asbidAccepted). The listener seesrenderer === undefined, returns, and the registry stays empty.Fix (minimal, additive)
Stash the descriptor keyed by
requestId— a first-class field Prebid preserves — when the bids are built, and have thebidResponselistener fall back to that stash when the custom field is absent.interpretResponse(auctionBidsToPrebidBids):if (renderer) stashPendingApsRenderer(requestId, renderer)bidResponselistener:const renderer = bid[APS_RENDERER_FIELD] ?? takePendingApsRenderer(bid['requestId'])Map(256 entries);takedeletes on read.Additive by design: the existing custom-field path is unchanged, so cases where the field survives (e.g. unit/browser harness) behave exactly as before. The fallback engages only when Prebid has stripped the field. No new dependency; the bridge, descriptor format, server, and render path are untouched.
Verification
requestId.noAdfailures dropped sharply, and APS creatives rendered in-slot instead of erroring.