-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Pr 0507 - support for dctr, currency and multi-size ad slots #2887
Conversation
27th March 18: Merging Prebid Master into fork branch
…0507 Conflicts: modules/pubmaticBidAdapter.js test/spec/modules/pubmaticBidAdapter_spec.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @pm-manasi-moghe
These changes look okay. However when I was testing the merge to master by running our browserstack tests, I was seeing a consistent test failure in safari.
Below is a copy of the error details:
PubMatic adapter
implementation
Request formation
�[31m✗ �[39m�[31mRequest params multi size format object check�[39m
expected [] to have a length above 0 but got 0
AssertionError@webpack:///node_modules/assertion-error/index.js:74 <- test/test_index.js:20203:22
assert@webpack:///node_modules/chai/lib/chai/assertion.js:107 <- test/test_index.js:27769:31
assertAbove@webpack:///node_modules/chai/lib/chai/core/assertions.js:563 <- test/test_index.js:28362:18
webpack:///node_modules/chai/lib/chai/utils/addMethod.js:41 <- test/test_index.js:27356:30
webpack:///test/spec/modules/pubmaticBidAdapter_spec.js:306:88 <- test/test_index.js:104082:99
Could you take a look and see what may be the problem?
Hi @jsnellbaker, The test case looks ok, and works at my end. I have made a small change in it, so as to narrow down the cause of the failure at your end. Please let me know the status with the updated code. |
modules/pubmaticBidAdapter.js
Outdated
@@ -251,6 +262,14 @@ function _createImpressionObject(bid, conf) { | |||
h: bid.params.height, | |||
topframe: utils.inIframe() ? 0 : 1, | |||
} | |||
if (utils.isArray(sizes) && sizes.length > 1) { | |||
sizes = sizes.splice(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran the updated unit test and the issue appeared to be the format object was getting an empty array.
I did some further debugging/experimenting and I believe the problem was due to this line of code.
When I added a proper range value as the 2nd param in the splice
(like the following), the unit test completed successfully in Safari. I wasn't able to find anything definitive but it seemed like this was needed for the es5 shim of the splice to work. Can you implement this change?
var range = sizes.length - 1;
sizes = sizes.splice(1, range);
Made the required changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the updates; LGTM
…2887) * merging latest prebid master with video changes * fixed linting errors * moved data types to constants * merging changes for currency support and multisize support * replace hardcoded string 'pubmatic' with BIDDER_CODE * added code for dctr support * trim individual values in key-value * additional log messages added * fixed linting errors * fix test cases for dctr * rename paramter bidfloorcur to currency. * rename param bidfloorcur to currency * remove data_types constant from constants.json * changes to test cases for format object * change to splice method call as per review comments
…2887) * merging latest prebid master with video changes * fixed linting errors * moved data types to constants * merging changes for currency support and multisize support * replace hardcoded string 'pubmatic' with BIDDER_CODE * added code for dctr support * trim individual values in key-value * additional log messages added * fixed linting errors * fix test cases for dctr * rename paramter bidfloorcur to currency. * rename param bidfloorcur to currency * remove data_types constant from constants.json * changes to test cases for format object * change to splice method call as per review comments
…2887) * merging latest prebid master with video changes * fixed linting errors * moved data types to constants * merging changes for currency support and multisize support * replace hardcoded string 'pubmatic' with BIDDER_CODE * added code for dctr support * trim individual values in key-value * additional log messages added * fixed linting errors * fix test cases for dctr * rename paramter bidfloorcur to currency. * rename param bidfloorcur to currency * remove data_types constant from constants.json * changes to test cases for format object * change to splice method call as per review comments
…2887) * merging latest prebid master with video changes * fixed linting errors * moved data types to constants * merging changes for currency support and multisize support * replace hardcoded string 'pubmatic' with BIDDER_CODE * added code for dctr support * trim individual values in key-value * additional log messages added * fixed linting errors * fix test cases for dctr * rename paramter bidfloorcur to currency. * rename param bidfloorcur to currency * remove data_types constant from constants.json * changes to test cases for format object * change to splice method call as per review comments
…2887) * merging latest prebid master with video changes * fixed linting errors * moved data types to constants * merging changes for currency support and multisize support * replace hardcoded string 'pubmatic' with BIDDER_CODE * added code for dctr support * trim individual values in key-value * additional log messages added * fixed linting errors * fix test cases for dctr * rename paramter bidfloorcur to currency. * rename param bidfloorcur to currency * remove data_types constant from constants.json * changes to test cases for format object * change to splice method call as per review comments
Type of change
Description of change
Be sure to test the integration with your adserver using the Hello World sample page.
For any changes that affect user-facing APIs or example code documented on http://prebid.org, please provide:
new parameter to specify currency and dctr prebid.github.io#890