-
Notifications
You must be signed in to change notification settings - Fork 769
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 for storedauctionresponse bid type #2615
Conversation
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
exchange/exchange.go
Outdated
@@ -1280,6 +1280,20 @@ func listBiddersWithRequests(bidderRequests []BidderRequest) []openrtb_ext.Bidde | |||
return liveAdapters | |||
} | |||
|
|||
func getMediaTypeForBid(bid openrtb2.Bid) (openrtb_ext.BidType, error) { |
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.
Nitpick: Consider changing the name to getPrebidMediaTypeForBid
to clarify what field this method is extracting.
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.
Done!
exchange/exchange.go
Outdated
mType := seat.Bid[i].MType | ||
var bidType openrtb_ext.BidType | ||
if mType > 0 { | ||
bidType = openrtb_ext.BidTypes()[mType-1] |
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 validate the mtype is valid (if greater than 0). If it's not valid, consider responding with the same BadServerResponse
message.
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.
Added
var err error | ||
bidType, err = getPrebidMediaTypeForBid(seat.Bid[i]) | ||
if err != nil { | ||
return nil, nil, nil, err |
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 error case has no test coverage.
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.
Added.
Are we ok to return error as is from ParseBidType
? Or is it better convert it to BadServerResponse
for consistency?
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 don't have a strong opinion on this. I do like consistency and support you on 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.
Discussed offline. No changes needed.
Fix for #2614