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

Core: fix bug where the PBS adapter always times out #10501

Merged
merged 1 commit into from
Sep 18, 2023
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
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