-
Notifications
You must be signed in to change notification settings - Fork 224
Module update: LI EID permissions #4315
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
base: master
Are you sure you want to change the base?
Conversation
|
|
||
| private BidRequest updateAllowedBidders(BidRequest bidRequest, List<Eid> resolvedEids) { | ||
| if (targetBidders.isEmpty()) { | ||
| if (targetBidders.isEmpty() || resolvedEids == null || resolvedEids.isEmpty()) { |
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.
Use CollectionUtils.isEmpty instead
| final List<ExtRequestPrebidDataEidPermissions> existingPerms = extPrebidData != null | ||
| ? ListUtils.emptyIfNull(extPrebidData.getEidPermissions()) | ||
| : List.of(); | ||
|
|
||
| if (existingPerms.isEmpty()) { | ||
| return bidRequest; | ||
| } |
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.
final List<ExtRequestPrebidDataEidPermissions> eidPermissions = extPrebidData != null ? extPrebidData.getEidPermissions() : null;
if (CollectionUtils.isEmpty(eidPermissions)) {
return bidRequest;
}
| resolvedSources.stream() | ||
| .map(source -> ExtRequestPrebidDataEidPermissions.of(source, targetBidders))) | ||
| .filter(StreamUtil.distinctBy(ExtRequestPrebidDataEidPermissions::getSource)) | ||
| .orElse(List.of()); |
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.
List.of -> Collections.emptyList()
| final List<String> current = ListUtils.emptyIfNull(permission.getBidders()); | ||
| final List<String> finalBidders = ListUtils.intersection(current, targetBidders); | ||
|
|
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.
Make targetBidders a set. If possible, do the same for permission.getBidders().
🔧 Type of changes
✨ What's the context?
Properly handling EID permissions in LiveIntent module
🧠 Rationale behind the change
Why did you choose to make these changes? Were there any trade-offs you had to consider?
🔎 New Bid Adapter Checklist
🧪 Test plan
How do you know the changes are safe to ship to production?
🏎 Quality check