Skip to content

Commit

Permalink
pbsBidAdapter: change order of client syncs (#6248)
Browse files Browse the repository at this point in the history
* pbsBidAdapter: change order cookie_syncs

Prebid Server places cookie-sync URLs in a specific order. PBJS was pulling them off in reverse order.

* moving comment

* reverting coopSync
  • Loading branch information
bretg authored Feb 2, 2021
1 parent e60d10b commit 802cfd0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/prebidServerBidAdapter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,14 @@ function doAllSyncs(bidders, s2sConfig) {
return;
}

const thisSync = bidders.pop();
// pull the syncs off the list in the order that prebid server sends them
const thisSync = bidders.shift();

// if PBS reports this bidder doesn't have an ID, then call the sync and recurse to the next sync entry
if (thisSync.no_cookie) {
doPreBidderSync(thisSync.usersync.type, thisSync.usersync.url, thisSync.bidder, utils.bind.call(doAllSyncs, null, bidders, s2sConfig), s2sConfig);
} else {
// bidder already has an ID, so just recurse to the next sync entry
doAllSyncs(bidders, s2sConfig);
}
}
Expand Down

0 comments on commit 802cfd0

Please sign in to comment.