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

Prebid Server Bid Adapter: normalize pbs adapter auction ids #6836

Closed

Conversation

idettman
Copy link
Contributor

Type of change

  • Other

Description of change

Normalize PBJS and PBS auction IDs #6563

Update for Issue: #6563

nakamoto and others added 30 commits February 16, 2019 21:30
# Conflicts:
#	modules/advangelistsBidAdapter.js
#	test/spec/modules/advangelistsBidAdapter_spec.js
@idettman idettman linked an issue May 26, 2021 that may be closed by this pull request
@idettman idettman added needs 2nd review Core module updates require two approvals from the core team needs review labels May 26, 2021
@ChrisHuie ChrisHuie changed the title normalize pbs adapter auction ids Prebid Server Bid Adapter: normalize pbs adapter auction ids Jun 8, 2021
@ChrisHuie
Copy link
Collaborator

@idettman pulling in upstream should get rid of the current circle ci errors

@robertrmartinez robertrmartinez self-requested a review June 16, 2021 17:46
id: s2sBidRequest.tid,
source: {tid: s2sBidRequest.tid},
id: firstBidRequest.auctionId,
source: {tid: firstBidRequest.auctionId},
Copy link
Collaborator

Choose a reason for hiding this comment

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

It is possible that publishers can pass in their own auctionId's into requestBids

And in this case, we would want to be sure source.tid is always a UUID.

So after speaking with @bretg I think we should just generate a random UUID for source.tid here every time.

utils.generateUUID()

@bretg Can you comment and confirm?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good catch on the pub-specified auctionId. source.tid needs to be the same even if there are multiple PBS vendors. i.e. generate a new UUID for source.tid before we start looping through the vendors.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi there, can we move forward on this PR? I can help if needed.
cc @idettman

Copy link
Collaborator

Choose a reason for hiding this comment

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

@osazos - your help would be appreciated.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi @bretg, I finally got time to work on this one.

Regarding your last comment I would like to be sure we want this behavior because it is a breaking change. Actually a large part of the process is based on the fact the tid is unique by Vendor. See there:

var uniqueServerBidRequests = [];
serverBidRequests.forEach(serverBidRequest => {
var index = -1;
for (var i = 0; i < uniqueServerBidRequests.length; ++i) {
if (serverBidRequest.tid === uniqueServerBidRequests[i].tid) {
index = i;
break;
}
}
if (index <= -1) {
uniqueServerBidRequests.push(serverBidRequest);
}
});
let counter = 0
_s2sConfigs.forEach((s2sConfig) => {
if (s2sConfig && uniqueServerBidRequests[counter] && includes(s2sConfig.bidders, uniqueServerBidRequests[counter].bidderCode)) {
// s2s should get the same client side timeout as other client side requests.
const s2sAjax = ajaxBuilder(requestBidsTimeout, requestCallbacks ? {
request: requestCallbacks.request.bind(null, 's2s'),
done: requestCallbacks.done
} : undefined);
let adaptersServerSide = s2sConfig.bidders;
const s2sAdapter = _bidderRegistry[s2sConfig.adapter];
let tid = uniqueServerBidRequests[counter].tid;

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for looking at this @osazos. It would take me some time to sort out what the heck this thing is doing with "uniqueServerBidRequests", but I can say that source.tid needs to be the same for multiple PBS calls in the same auction.

So maybe we just leave "uniqueServerBidRequests" there and just generate a brand new thing to use as source.tid for the auction.

@robertrmartinez
Copy link
Collaborator

Addressed in new PR #7585

@robertrmartinez robertrmartinez deleted the normalize-pbjs-pbs-auction-ids branch July 5, 2023 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance needs review 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.

Normalize PBJS and PBS auction IDs
6 participants