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

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

Merged
merged 2 commits into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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