-
Notifications
You must be signed in to change notification settings - Fork 764
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
Fix: Triplelift Native add site.publisher nil check #3824
Conversation
Code coverage summaryNote:
triplelift_nativeRefer here for heat map coverage report
|
@patrickloughrey please take a look. I also imagine that you don't have to perform a similar check on |
Discussed offline. They don't have app inventory enabled at this time but would like to handle this case to be safe. |
Code coverage summaryNote:
triplelift_nativeRefer here for heat map coverage report
|
Code coverage summaryNote:
triplelift_nativeRefer here for heat map coverage report
|
45d1f05
to
8ff11b6
Compare
Code coverage summaryNote:
triplelift_nativeRefer here for heat map coverage report
|
Code coverage summaryNote:
triplelift_nativeRefer here for heat map coverage report
|
Code coverage summaryNote:
triplelift_nativeRefer here for heat map coverage report
|
var siteCopy openrtb2.Site | ||
var extData ExtImpData |
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 pointed out by @guscarreon, these two variables are only ever read; they aren't written so we can get rid of them and just read the data from the original source.
if ext.Data != nil { | ||
extData = *ext.Data | ||
} | ||
|
||
if extData.TagCode != "" { | ||
if siteCopy.Publisher.Domain == "msn.com" { | ||
imp.TagID = extData.TagCode | ||
} else { | ||
imp.TagID = tlext.InvCode | ||
} |
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.
This logic has been simplified as pointed out by @guscarreon.
func msnInApp(request *openrtb2.BidRequest) bool { | ||
return request.App != nil && request.App.Publisher != nil && request.App.Publisher.Domain == "msn.com" | ||
} |
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.
Adding support for app.publisher as discussed.
|
||
// msnInSite returns whether msn.com is in request.site.publisher.domain | ||
func msnInSite(request *openrtb2.BidRequest) bool { | ||
return request.Site != nil && request.Site.Publisher != nil && request.Site.Publisher.Domain == "msn.com" |
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.
Nil checks added to address panics.
Code coverage summaryNote:
triplelift_nativeRefer here for heat map coverage report
|
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.
LGTM
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.
Please see my comment on the InvCode == ""
code changes.
Code coverage summaryNote:
triplelift_nativeRefer here for heat map coverage report
|
LGTM |
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.
LGTM
This PR fixes panics in the Triplelift Native adapter introduced in v2.25.0.