Skip to content

Commit

Permalink
PBS adapter: fix bug where incorrect bidderCode is used on certain br…
Browse files Browse the repository at this point in the history
…owsers (#11848)

* PBS adapter: fix bug where incorrect bidderCode is used on certain browsers

* Do not mention OS version in safari_latest
  • Loading branch information
dgirardi authored Jun 22, 2024
1 parent b92bff3 commit 8000f23
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 3 additions & 3 deletions browsers.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
"device": null,
"os": "Windows"
},
"bs_safari_latest_mac_ventura": {
"bs_safari_latest_mac": {
"base": "BrowserStack",
"os_version": "Ventura",
"os_version": "Sonoma",
"browser": "safari",
"browser_version": "latest",
"device": null,
Expand All @@ -47,5 +47,5 @@
"device": null,
"os": "OS X"
}

}
2 changes: 1 addition & 1 deletion libraries/ortbConverter/converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export function ortbConverter({
throw new Error('ortbRequest passed to `fromORTB` must be the same object returned by `toORTB`')
}
function augmentContext(ctx, extraParams = {}) {
return Object.assign(ctx, {ortbRequest: request}, extraParams, ctx);
return Object.assign(ctx, {ortbRequest: request}, extraParams);
}
const impsById = Object.fromEntries((request.imp || []).map(imp => [imp.id, imp]));
const bidResponses = (response.seatbid || []).flatMap(seatbid =>
Expand Down
10 changes: 7 additions & 3 deletions test/spec/ortbConverter/converter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ describe('pbjs-ortb converter', () => {
if (context.reqContext?.ctx) {
bidResponse.reqCtx = context.reqContext?.ctx;
}
bidResponse.seatbid = context.seatbid;
}
}
},
Expand Down Expand Up @@ -116,13 +117,16 @@ describe('pbjs-ortb converter', () => {
const response = cvt.fromORTB({request, response: MOCK_ORTB_RESPONSE});
expect(response.bids).to.eql([{
impid: 'imp0',
bidId: 111
bidId: 111,
seatbid: MOCK_ORTB_RESPONSE.seatbid[0]
}, {
impid: 'imp1',
bidId: 112
bidId: 112,
seatbid: MOCK_ORTB_RESPONSE.seatbid[0]
}, {
impid: 'imp1',
bidId: 112
bidId: 112,
seatbid: MOCK_ORTB_RESPONSE.seatbid[1]
}]);
expect(response.marker).to.be.true;
});
Expand Down

0 comments on commit 8000f23

Please sign in to comment.