Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix two issues related to hb_uuid and hb_cache_id targeting keys #3605

Merged
merged 7 commits into from
Mar 4, 2019

Conversation

jsnellbaker
Copy link
Collaborator

Type of change

  • Bugfix

NOTE This is the re-submission of #3568 (which was reverted due to a last minute code conflict that came when #3573 was merged to master).

Description of change

This PR incorporates some fixes related to the hb_uuid and hb_cache_id targeting keys.

Some issues that were fixed:

  • due to the order in which the code was executed, the bid.adserverTargeting.hb_uuid and bid.adserverTargeting.hb_cache_id fields weren't properly populated with the bid's videoCacheKey after it came back from Prebid Cache. This caused other functions that pulled the targeting keys (like pbjs.getAdserverTargetingForAdUnitCode()) to be missing this information when it was otherwise expected to be there.

  • a consequence to the above issue, when the publisher tried to overwrite the values for these keys in the pbjs.bidderSettings feature - the overwrites wouldn't work because the bid.videoCacheKey wasn't populated at the time these bidderSettings values were used.

The changes in this PR addresses the above issues through mainly moving the code around to populate the bid.adserverTargeting object once we know the bid is complete (ie back from prebid cache for that use-case).

Note - removed the dfpAdServerVideo code since it's now redundant.

@@ -386,6 +386,10 @@ export function doCallbacksIfTimedout(auctionInstance, bidResponse) {

// Add a bid to the auction.
export function addBidToAuction(auctionInstance, bidResponse) {
let bidderRequests = auctionInstance.getBidRequests();
let bidderRequest = find(bidderRequests, bidderRequest => bidderRequest.bidderCode === bidResponse.bidderCode);
setupBidTargeting(bidResponse, bidderRequest);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why are we calling this function for all formats ? We need hb_uuid and hb_cache_id only when cache is done i.e only for video as of now. Won't it be easier if we attach after hook function to callPrebidCache. That way these two targeting keys will only be added if we do caching.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because it's not exclusively used by the cache related keys; it sets up all the targeting for the bid object.

@jaiminpanchal27 jaiminpanchal27 added LGTM needs 2nd review Core module updates require two approvals from the core team labels Mar 1, 2019
Copy link
Member

@mkendall07 mkendall07 left a comment

Choose a reason for hiding this comment

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

LGTM

@mkendall07 mkendall07 merged commit 6bc6394 into master Mar 4, 2019
@jsnellbaker jsnellbaker deleted the video_keys branch March 18, 2019 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LGTM needs 2nd review Core module updates require two approvals from the core team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants