Skip to content

Commit 802cfd0

Browse files
authored
pbsBidAdapter: change order of client syncs (#6248)
* 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
1 parent e60d10b commit 802cfd0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

modules/prebidServerBidAdapter/index.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,14 @@ function doAllSyncs(bidders, s2sConfig) {
223223
return;
224224
}
225225

226-
const thisSync = bidders.pop();
226+
// pull the syncs off the list in the order that prebid server sends them
227+
const thisSync = bidders.shift();
228+
229+
// if PBS reports this bidder doesn't have an ID, then call the sync and recurse to the next sync entry
227230
if (thisSync.no_cookie) {
228231
doPreBidderSync(thisSync.usersync.type, thisSync.usersync.url, thisSync.bidder, utils.bind.call(doAllSyncs, null, bidders, s2sConfig), s2sConfig);
229232
} else {
233+
// bidder already has an ID, so just recurse to the next sync entry
230234
doAllSyncs(bidders, s2sConfig);
231235
}
232236
}

0 commit comments

Comments
 (0)