-
Notifications
You must be signed in to change notification settings - Fork 1
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
TL-23327: Additional filterEids logic #39
Conversation
TL-19968: pubcid support
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.3 to 6.5.4. - [Release notes](https://github.com/indutny/elliptic/releases) - [Commits](indutny/elliptic@v6.5.3...v6.5.4) Signed-off-by: dependabot[bot] <support@github.com>
…rn/elliptic-6.5.4 Bump elliptic from 6.5.3 to 6.5.4
…npm_and_yarn/elliptic-6.5.4 Revert "Bump elliptic from 6.5.3 to 6.5.4"
TL-22981: Increase Prebid JS Instream TTL
.map(formatEid(source, rtiPartner)); // userIds -> eid objects | ||
} | ||
|
||
const filterEids = type => (userId, i, arr) => { |
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.
Not sure how to do this another way but ES6 is ok to use.
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 this is syntactically correct (albeit, looks a bit weird because of the implicit return) but it doesn't follow the convention of other function declarations in this file like
function getUserId(type) {
return (bid) => {
modules/tripleliftBidAdapter.js
Outdated
.map(formatEid(source, rtiPartner)); // userIds -> eid objects | ||
} | ||
|
||
const filterEids = type => (userId, i, arr) => { | ||
try { | ||
let isValidUserId = |
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.
The following is almost painfully explicit in what the adapter will permit as a valid userId. Was thinking of writing a 'deep check for "id"' recursive function or similar but I don't think it's necessary. Maybe if in the future we see pubs sending things like {lev1: {lev2: {lev3: {id: "abc"}}}} then we can change but I'm not seeing any examples of that.
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.
Looks fine to me. Seems like a case where being more strict is better than not.
expect(payload.user.ext.eids).to.be.an('array'); | ||
expect(payload.user.ext.eids).to.have.lengthOf(2); | ||
|
||
tdidId = {}; // fail; can't be empty object |
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.
Is it possible to test all the conditions of isValidUserId
in a single AAA setup?
caaf115
to
7123eae
Compare
Type of change
Description of change
Resolves https://triplelift.atlassian.net/browse/TL-23327
Publishers are customizing how the pubcommonid module fundamentally works, causing our endpoint to error out/bids not to monetize. There are 2 primary consistent non-standard use cases that this PR will either reject or allow through.
id should be a string.
Rejects id:{}
Use id.id as last resort if it's a string