Skip to content
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

Merged
merged 6 commits into from
Mar 20, 2023

Conversation

VeronikaSolovei9
Copy link
Contributor

Fix for #2614

@VeronikaSolovei9 VeronikaSolovei9 changed the title Fix for storedauctionresponse type Fix for storedauctionresponse bid type Mar 2, 2023
@hhhjort hhhjort requested review from hhhjort and SyntaxNode March 2, 2023 18:19
hhhjort
hhhjort previously approved these changes Mar 2, 2023
Copy link
Collaborator

@hhhjort hhhjort left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

hhhjort
hhhjort previously approved these changes Mar 8, 2023
@@ -1280,6 +1280,20 @@ func listBiddersWithRequests(bidderRequests []BidderRequest) []openrtb_ext.Bidde
return liveAdapters
}

func getMediaTypeForBid(bid openrtb2.Bid) (openrtb_ext.BidType, error) {
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

mType := seat.Bid[i].MType
var bidType openrtb_ext.BidType
if mType > 0 {
bidType = openrtb_ext.BidTypes()[mType-1]
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

hhhjort
hhhjort previously approved these changes Mar 14, 2023
var err error
bidType, err = getPrebidMediaTypeForBid(seat.Bid[i])
if err != nil {
return nil, nil, nil, err
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants