-
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
Extending the Real Time Data Module #5519
Conversation
browsi sub module for real time data, new hook bidsBackCallback, fix for config unsubscribe
configure submodule on submodules.json
browsi sub module for real time data, new hook bidsBackCallback, fix for config unsubscribe
configure submodule on submodules.json
# Conflicts: # modules/browsiRtdProvider.js
# Conflicts: # modules/browsiRtdProvider.js # modules/rtdModule/index.js
/** | ||
* @property | ||
* @summary delay auction for this sub module | ||
* @name ModuleConfig#waitForIt |
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.
would renaming waitForIt
to isAsync
express the intention more clearly ?
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.
all are async, so it might be confusing. please see comment on the second conversation
modules/rtdModule/index.js
Outdated
const callbackExpected = subModules.length; | ||
let dataReceived = []; | ||
export function getProviderData(adUnits, callback) { | ||
const mustWaitSubModulesLength = subModules.filter(sm => sm.config && sm.config.waitForIt).length; |
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.
would asyncSubmodulesCount
be a more expressive var name ?
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.
all submodules are async
the wait for is actually a way to say what submodules are less important - meaning we prefer not to delay the auction any more for them
I did change the names a bit, let me know what you think
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 understand now thank you so much for the clarification! I think "topPriority" would be a good term; it might be easier for future readers
modules/rtdModule/index.js
Outdated
export function getProviderData(adUnits, callback) { | ||
const mustWaitSubModulesLength = subModules.filter(sm => sm.config && sm.config.waitForIt).length; | ||
let callbackExpected = mustWaitSubModulesLength || subModules.length; | ||
const mustHaveModules = mustWaitSubModulesLength > 0; |
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.
how about isAsync
or mustWait
as var name alternatives ? At first I didn't understand what mustHaveModules
meant
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.
changed the names a bit and added comments on the function, hope it makes things more clear
@omerBrowsi an integration test failed because |
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 think on the whole this looks okay. I did have a questions/concern on one part. Please see in-line comments below.
Thanks for putting this together.
modules/rtdModule/index.js
Outdated
let subModulesByOrder = []; | ||
_dataProviders.forEach(provider => { | ||
const sm = subModules.find(s => s.name === provider.name); | ||
const initResponse = sm && sm.init && sm.init(provider, gdprDataHandler.getConsentData(), uspDataHandler.getConsentData()) !== 'failure'; |
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.
To clarify on the GDPR and USP data, are we sure that in the sequence of things that this data would be available by the time the submodule's init
functions are called?
This initSubModules
function is loaded as part of the overall rtdModule's init()
, which in turn is loaded as the file is loaded.
But the consent information is obtained once the requestBids
call chain starts, which should be after this code here has already executed. So could there be a scenario here where these consent params in the sm.init
wouldn't have the real data? Or am I misreading something?
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.
Yes, you are correct
I added a hook so it will run before 'makeBidRequests', if you think of a better solution please let me know
variables naming
This pull request introduces 1 alert when merging 735e8e9 into 477fe0c - view on LGTM.com new alerts:
|
Hi @omerBrowsi and @jsnellbaker is there an ETA for when this branch will be merged ? It's currently a blocker for #5537 |
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.
Can we separate the test cases for RTD Module and BrowsiViewability(RTD Sub-module)?
Hey @robertrmartinez, would you be able to get to this PR? tools PMC really wants to push it asap. |
We already have two reviewers, so taking Bobby off as a required reviewer. @Asafsham - we're going to a document at some point soon: a 'how to write an RTD module' guide similar to https://docs.prebid.org/dev-docs/integrate-with-the-prebid-analytics-api.html But I'm not going to call that a blocker. So if @pm-harshad-mane is willing to push his unit test splitting request to a future PR, this can be merged. |
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.
As discussed with @bretg , unit test cases will be implemented in a separate PR.
@omerBrowsi please add unit-test cases soon :-)
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'd like for this to work like the User ID sub-modules: when someone builds the 'browsiRtdProvider', the RTD core is automatically added. Am going to assume that's the case as I see this in https://github.com/prebid/Prebid.js/blob/master/modules/.submodules.json
@bretg @pm-harshad-mane We are working on the Docs, should be ready be Monday. |
* real time data module, browsi sub module for real time data, new hook bidsBackCallback, fix for config unsubscribe * change timeout&primary ad server only to auctionDelay update docs * support multiple providers * change promise to callbacks configure submodule on submodules.json * bug fixes * use Prebid ajax * tests fix * browsi real time data provider improvements * real time data module, browsi sub module for real time data, new hook bidsBackCallback, fix for config unsubscribe * change timeout&primary ad server only to auctionDelay update docs * support multiple providers * change promise to callbacks configure submodule on submodules.json * bug fixes * use Prebid ajax * tests fix * browsi real time data provider improvements * RTD module extend prebid#4610 * add hook for submodule init variables naming
This reverts commit e47b087.
Real time data module according to -
#4610