Skip to content

Commit 0c560a3

Browse files
sebmil-dailyKevin Siow
and
Kevin Siow
authored
Dailymotion bid adapter: Fix user sync parsing (#11887)
This fixes an issue in the server response parsing for user sync, where it was not using the body from the response. I took the occasion to also convert this member to camelCase for consistency with the others. Co-authored-by: Kevin Siow <[email protected]>
1 parent 67774de commit 0c560a3

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

modules/dailymotionBidAdapter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ export const spec = {
224224
const pixelSyncs = [];
225225

226226
serverResponses.forEach((response) => {
227-
(response.user_syncs || []).forEach((syncUrl) => {
227+
(response?.body?.userSyncs || []).forEach((syncUrl) => {
228228
if (syncUrl.type === 'image') {
229229
pixelSyncs.push({ url: syncUrl.url, type: 'image' });
230230
}

test/spec/modules/dailymotionBidAdapter_spec.js

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ describe('dailymotionBidAdapterTests', () => {
647647

648648
// No permissions
649649
{
650-
const responses = [{ user_syncs: [{ url: 'https://usersyncurl.com', type: 'image' }] }];
650+
const responses = [{ body: { userSyncs: [{ url: 'https://usersyncurl.com', type: 'image' }] } }];
651651
const syncOptions = { iframeEnabled: false, pixelEnabled: false };
652652

653653
expect(config.runWithBidder(
@@ -656,7 +656,7 @@ describe('dailymotionBidAdapterTests', () => {
656656
)).to.eql([]);
657657
}
658658

659-
// Has permissions but no user_syncs urls
659+
// Has permissions but no userSyncs urls
660660
{
661661
const responses = [{}];
662662
const syncOptions = { iframeEnabled: false, pixelEnabled: true };
@@ -667,14 +667,16 @@ describe('dailymotionBidAdapterTests', () => {
667667
)).to.eql([]);
668668
}
669669

670-
// Return user_syncs urls for pixels
670+
// Return userSyncs urls for pixels
671671
{
672672
const responses = [{
673-
user_syncs: [
674-
{ url: 'https://usersyncurl.com', type: 'image' },
675-
{ url: 'https://usersyncurl2.com', type: 'image' },
676-
{ url: 'https://usersyncurl3.com', type: 'iframe' }
677-
],
673+
body: {
674+
userSyncs: [
675+
{ url: 'https://usersyncurl.com', type: 'image' },
676+
{ url: 'https://usersyncurl2.com', type: 'image' },
677+
{ url: 'https://usersyncurl3.com', type: 'iframe' }
678+
],
679+
}
678680
}];
679681

680682
const syncOptions = { iframeEnabled: false, pixelEnabled: true };
@@ -688,14 +690,16 @@ describe('dailymotionBidAdapterTests', () => {
688690
]);
689691
}
690692

691-
// Return user_syncs urls for iframes
693+
// Return userSyncs urls for iframes
692694
{
693695
const responses = [{
694-
user_syncs: [
695-
{ url: 'https://usersyncurl.com', type: 'image' },
696-
{ url: 'https://usersyncurl2.com', type: 'image' },
697-
{ url: 'https://usersyncurl3.com', type: 'iframe' }
698-
],
696+
body: {
697+
userSyncs: [
698+
{ url: 'https://usersyncurl.com', type: 'image' },
699+
{ url: 'https://usersyncurl2.com', type: 'image' },
700+
{ url: 'https://usersyncurl3.com', type: 'iframe' }
701+
],
702+
}
699703
}];
700704

701705
const syncOptions = { iframeEnabled: true, pixelEnabled: true };

0 commit comments

Comments
 (0)