-
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
Feature/s2s client side fallback #1485
Conversation
@protonate looks like tests are failing |
.gitignore
Outdated
@@ -6,6 +6,7 @@ build | |||
test/app | |||
gpt.html | |||
gpt-each-bidder3.html | |||
nate_dev |
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.
FYI: You can stick "personal" ignores in your ~/.gitignore_global
. It'll apply to all your git repos that way.
Great place for stuff like .DS_Store
too.
src/config.js
Outdated
@@ -12,7 +12,7 @@ const utils = require('./utils'); | |||
const DEFAULT_DEBUG = false; | |||
const DEFAULT_BIDDER_TIMEOUT = 3000; | |||
const DEFAULT_PUBLISHER_DOMAIN = window.location.origin; | |||
const DEFAULT_COOKIESYNC_DELAY = 100; | |||
const DEFAULT_COOKIESYNC_DELAY = 500; |
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.
why did this change?
tests still failing. |
filter s2s bidders by already synced return true/false from sync operations update storage item with bidder name on success remove bidder from storage time if fail
…unctions with binding to current bidder
* set bidder synced flag on fireSyncs * set storage item correctly * remove onload callbacks * remove personal .gitignore * unwind changes no longer needed
6d1a898
to
eaa9964
Compare
src/cookie.js
Outdated
function setBidderSynced(bidder) { | ||
setStorageItem(S2S.SYNCED_BIDDERS_KEY, getStorageItem(S2S.SYNCED_BIDDERS_KEY) | ||
.concat([bidder]) | ||
.filter(utils.uniques)); |
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.
Why not use an object? {'appnexus': 1, 'rubicon": 1}
Uniqueness comes for free, and your lookup in adaptermanager
should be constant instead of linear.
@@ -56,6 +56,7 @@ | |||
"DEFAULT_ENDPOINT" : "https://prebid.adnxs.com/pbs/v1/auction", | |||
"SRC" : "s2s", | |||
"ADAPTER" : "prebidServer", | |||
"SYNC_ENDPOINT" : "https://prebid.adnxs.com/pbs/v1/cookie_sync" | |||
"SYNC_ENDPOINT" : "https://prebid.adnxs.com/pbs/v1/cookie_sync", | |||
"SYNCED_BIDDERS_KEY": "pbjsSyncs" |
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.
@mkendall07 pointed out in another one of my PRs that this constants
file does more harm than good, now that we can export const SYNCED_BIDDERS_KEY = "pbjsSyncs"
somewhere in the code. I think he's got a good point.
src/storagemanager.js
Outdated
* Only html5 localStorage implemented currently. | ||
* | ||
* @param key | ||
* @param item |
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.
@param {string} key
and @param {*} item
?
@@ -86,7 +88,7 @@ exports.callBids = ({adUnits, cbTimeout}) => { | |||
|
|||
if (_s2sConfig.enabled) { | |||
// these are called on the s2s adapter | |||
let adaptersServerSide = _s2sConfig.bidders; | |||
let adaptersServerSide = _s2sConfig.bidders.filter(bidder => syncedBidders.includes(bidder)); |
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.
if this results in empty array, don't call prebidServer.
… flags * improve storagemanager with `add` and `remove` higher level functions * handle null return from StorageManager.get
…built * 'master' of https://github.com/prebid/Prebid.js: (83 commits) feat(strAdapt): check if tagJS is already present (prebid#1500) Updated karma-mocha, and simplified the test framework for runs which dont include --watch. (prebid#1520) Revert "drop specific code for index adapter (prebid#1487)" (prebid#1529) Override default asset params when set on ad unit (prebid#1524) Adding new kv to xhb Adapter (prebid#1513) removing for...of loops because IE cannot handle them properly (prebid#1523) Increment pre version Prebid 0.27.0 Release Move unit test file to appropriate location (prebid#1516) Support 'cta' native asset (prebid#1505) Add adapter parameter types (prebid#1504) Register bid adapter (prebid#1514) Match port when testing legacy browser (prebid#1511) modify 'featureforward' adapter to be an indepandant adapter (prebid#1288) Feature/s2s client side fallback (prebid#1485) Make bid.vastUrl use the cache URL if the bid didnt already have one. (prebid#1506) OpenX Adapter Update: (prebid#1438) Add session id feature for roxot analytics adapter (prebid#1498) Update platformioBidAdapter (prebid#1493) Adding VAST Payload support for video bids (prebid#1407) ...
* add a storagemanager to access local storage filter s2s bidders by already synced return true/false from sync operations update storage item with bidder name on success remove bidder from storage time if fail * set storage item if not exists * use Array.includes * ignore dev test folder * storagemanager uses JSON parse and stringify * pass resolve and reject callbacks to insert cookie and insert pixel functions with binding to current bidder * just get storage, tinker with cookie sync delay * Set synced flag on fireSyncs feel good * set bidder synced flag on fireSyncs * set storage item correctly * remove onload callbacks * remove personal .gitignore * unwind changes no longer needed * fix test * update to use factory pattern, and test * rename storage manager functions to `get` and `set` * remove localStorage ref * handle first run case with uids and uuid2 cookies but no localStorage flags * improve storagemanager with `add` and `remove` higher level functions * handle null return from StorageManager.get * don't send auction on first request * only fire sync if needed
* add a storagemanager to access local storage filter s2s bidders by already synced return true/false from sync operations update storage item with bidder name on success remove bidder from storage time if fail * set storage item if not exists * use Array.includes * ignore dev test folder * storagemanager uses JSON parse and stringify * pass resolve and reject callbacks to insert cookie and insert pixel functions with binding to current bidder * just get storage, tinker with cookie sync delay * Set synced flag on fireSyncs feel good * set bidder synced flag on fireSyncs * set storage item correctly * remove onload callbacks * remove personal .gitignore * unwind changes no longer needed * fix test * update to use factory pattern, and test * rename storage manager functions to `get` and `set` * remove localStorage ref * handle first run case with uids and uuid2 cookies but no localStorage flags * improve storagemanager with `add` and `remove` higher level functions * handle null return from StorageManager.get * don't send auction on first request * only fire sync if needed
* add a storagemanager to access local storage filter s2s bidders by already synced return true/false from sync operations update storage item with bidder name on success remove bidder from storage time if fail * set storage item if not exists * use Array.includes * ignore dev test folder * storagemanager uses JSON parse and stringify * pass resolve and reject callbacks to insert cookie and insert pixel functions with binding to current bidder * just get storage, tinker with cookie sync delay * Set synced flag on fireSyncs feel good * set bidder synced flag on fireSyncs * set storage item correctly * remove onload callbacks * remove personal .gitignore * unwind changes no longer needed * fix test * update to use factory pattern, and test * rename storage manager functions to `get` and `set` * remove localStorage ref * handle first run case with uids and uuid2 cookies but no localStorage flags * improve storagemanager with `add` and `remove` higher level functions * handle null return from StorageManager.get * don't send auction on first request * only fire sync if needed
* add a storagemanager to access local storage filter s2s bidders by already synced return true/false from sync operations update storage item with bidder name on success remove bidder from storage time if fail * set storage item if not exists * use Array.includes * ignore dev test folder * storagemanager uses JSON parse and stringify * pass resolve and reject callbacks to insert cookie and insert pixel functions with binding to current bidder * just get storage, tinker with cookie sync delay * Set synced flag on fireSyncs feel good * set bidder synced flag on fireSyncs * set storage item correctly * remove onload callbacks * remove personal .gitignore * unwind changes no longer needed * fix test * update to use factory pattern, and test * rename storage manager functions to `get` and `set` * remove localStorage ref * handle first run case with uids and uuid2 cookies but no localStorage flags * improve storagemanager with `add` and `remove` higher level functions * handle null return from StorageManager.get * don't send auction on first request * only fire sync if needed
Type of change
Description of change