Skip to content
Closed
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 modules/alliance_gravityBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var adUnits = [
bids: [{
bidder: 'alliance_gravity',
params: {
srid: "test-id"
placementId: "test-id"
}
}]
},
Expand Down
6 changes: 3 additions & 3 deletions modules/alliance_gravityBidAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const DEFAULT_GZIP_ENABLED = false;

declare module '../src/adUnits' {
interface BidderParams {
srid: string
placementId: string
}
}

Expand All @@ -37,7 +37,7 @@ const converter = ortbConverter({
deepSetValue(imp, 'ext.dimensions.cssMaxW', slotEl.style?.maxWidth);
deepSetValue(imp, 'ext.dimensions.cssMaxH', slotEl.style?.maxHeight);
}
deepSetValue(imp, 'ext.prebid.storedrequest.id', bidRequest.params.srid);
deepSetValue(imp, 'ext.prebid.storedrequest.id', bidRequest.params.placementId);
return imp;
},
request(buildRequest, imps, bidderRequest, context) {
Expand All @@ -46,7 +46,7 @@ const converter = ortbConverter({
});

const isBidRequestValid = (bid:BidRequest<typeof BIDDER_CODE>): boolean => {
if (!bid.params.srid || typeof bid.params.srid !== 'string' || bid.params.srid === '') {
if (!bid.params.placementId || typeof bid.params.placementId !== 'string' || bid.params.placementId === '') {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Support legacy srid param for existing integrations

This change makes placementId the only accepted bid param, so any existing publisher config still sending params.srid will fail isBidRequestValid() and the adapter will skip bidding entirely. Because bidder params are part of the adapter’s public interface, renaming without a compatibility fallback is a production-breaking regression for already-deployed integrations that have not been migrated in lockstep.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No integrations yet

return false;
}
return true;
Expand Down
22 changes: 11 additions & 11 deletions test/spec/modules/alliance_gravityBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,28 @@ describe('Alliance Gravity bid adapter tests', () => {
}
});

it('No srid', () => {
it('No placementId', () => {
bannerBid.params = {};
expect(spec.isBidRequestValid(bannerBid)).to.be.equal(false);
});

it('Invalid srid type (number)', () => {
bannerBid.params = { srid: 1234 };
it('Invalid placementId type (number)', () => {
bannerBid.params = { placementId: 1234 };
expect(spec.isBidRequestValid(bannerBid)).to.be.equal(false);
});

it('Invalid srid type (object', () => {
bannerBid.params = { srid: {} };
it('Invalid placementId type (object)', () => {
bannerBid.params = { placementId: {} };
expect(spec.isBidRequestValid(bannerBid)).to.be.equal(false);
});

it('Empty srid', () => {
bannerBid.params = { srid: '' };
it('Empty placementId', () => {
bannerBid.params = { placementId: '' };
expect(spec.isBidRequestValid(bannerBid)).to.be.equal(false);
});

it('Valid srid', () => {
bannerBid.params = { srid: '12345' };
it('Valid placementId', () => {
bannerBid.params = { placementId: '12345' };
expect(spec.isBidRequestValid(bannerBid)).to.be.equal(true);
});
});
Expand All @@ -75,7 +75,7 @@ describe('Alliance Gravity bid adapter tests', () => {
{
bidder: 'alliance_gravity',
params: {
srid: "12345"
placementId: "12345"
},
adUnitCode: 'header-ad-1234',
transactionId: '469a570d-f187-488d-b1cb-48c1a2009be9',
Expand All @@ -87,7 +87,7 @@ describe('Alliance Gravity bid adapter tests', () => {
{
bidder: 'alliance_gravity',
params: {
srid: '67890',
placementId: '67890',
},
mediaTypes: {
banner: {
Expand Down
Loading