Skip to content

Commit

Permalink
Core: fix bug where the PBS adapter always times out (prebid#10501)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgirardi authored and pm-azhar-mulla committed Oct 10, 2023
1 parent 9501632 commit a21ca1c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/adapterManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ adapterManager.callBids = (adUnits, bidRequests, addBidResponse, doneCb, request
bidRequest.start = timestamp();
return function () {
onTimelyResponse(bidRequest.bidderRequestId);
doneCbs.apply(bidRequest, arguments);
doneCb.apply(bidRequest, arguments);
}
});

Expand Down
12 changes: 11 additions & 1 deletion test/spec/unit/core/adapterManager_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -965,13 +965,23 @@ describe('adapterManager tests', function () {
}];

it('invokes callBids on the S2S adapter', function () {
const done = sinon.stub();
const onTimelyResponse = sinon.stub();
prebidServerAdapterMock.callBids.callsFake((_1, _2, _3, done) => {
done();
});
adapterManager.callBids(
getAdUnits(),
bidRequests,
() => {},
() => () => {}
done,
undefined,
undefined,
onTimelyResponse
);
sinon.assert.calledTwice(prebidServerAdapterMock.callBids);
sinon.assert.calledTwice(done);
bidRequests.forEach(br => sinon.assert.calledWith(onTimelyResponse, br.bidderRequestId));
});

// Enable this test when prebidServer adapter is made 1.0 compliant
Expand Down

0 comments on commit a21ca1c

Please sign in to comment.