-
Notifications
You must be signed in to change notification settings - Fork 753
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
Silvermob: Use mtype and add global host #3936
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a52cec6
host validation (us, eu, apac)
freemmy 0ffb7cc
Code optimizations
freemmy b21876c
Merge branch 'prebid:master' into master
freemmy 8a597e3
MediaType detection by mtype, global host added
freemmy 457a76d
Fixed incorrect assignment made to Bid
freemmy 2e4b140
Merge remote-tracking branch 'upstream/master'
freemmy 65354fa
Removed audio
freemmy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
117 changes: 117 additions & 0 deletions
117
adapters/silvermob/silvermobtest/supplemental/invalid-mtype-missing.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
|
||
{ | ||
"mockBidRequest": { | ||
"id": "some-request-id", | ||
"tmax": 1000, | ||
"user": { | ||
"buyeruid": "awesome-user" | ||
}, | ||
"app": { | ||
"id": "app_001", | ||
"bundle": "com.awesome.app", | ||
"publisher": { | ||
"id": "2" | ||
} | ||
}, | ||
"imp": [ | ||
{ | ||
"id": "some-impression-id", | ||
"tagid": "ogTAGID", | ||
"video": { | ||
"mimes": ["video/mp4"], | ||
"w": 640, | ||
"h": 480, | ||
"minduration": 120, | ||
"maxduration": 150 | ||
}, | ||
"ext": { | ||
"bidder": { | ||
"host": "eu", | ||
"zoneid": "0" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
|
||
"httpCalls": [{ | ||
"expectedRequest": { | ||
"uri": "http://eu.example.com/api/dsp/bid/0", | ||
"body": { | ||
"id": "some-request-id", | ||
"imp": [ | ||
{ | ||
"id": "some-impression-id", | ||
"tagid": "ogTAGID", | ||
"video": { | ||
"mimes": [ | ||
"video/mp4" | ||
], | ||
"minduration": 120, | ||
"maxduration": 150, | ||
"w": 640, | ||
"h": 480 | ||
}, | ||
"ext": { | ||
"bidder": { | ||
"host": "eu", | ||
"zoneid": "0" | ||
} | ||
} | ||
} | ||
], | ||
"app": { | ||
"id": "app_001", | ||
"bundle": "com.awesome.app", | ||
"publisher": { | ||
"id": "2" | ||
} | ||
}, | ||
"user": { | ||
"buyeruid": "awesome-user" | ||
}, | ||
"tmax": 1000 | ||
}, | ||
"impIDs":["some-impression-id"] | ||
}, | ||
"mockResponse": { | ||
"status": 200, | ||
"body": { | ||
"id": "awesome-resp-id", | ||
"seatbid": [ | ||
{ | ||
"bid": [ | ||
{ | ||
"id": "a3ae1b4e2fc24a4fb45540082e98e161", | ||
"impid": "some-impression-id", | ||
"price": 3.5, | ||
"adm": "awesome-markup", | ||
"adomain": [ | ||
"awesome.com" | ||
], | ||
"crid": "20", | ||
"w": 1280, | ||
"h": 720 | ||
} | ||
], | ||
"seat": "silvermob" | ||
} | ||
], | ||
"cur": "USD", | ||
"ext": { | ||
"responsetimemillis": { | ||
"silvermob": 154 | ||
}, | ||
"tmaxrequest": 1000 | ||
} | ||
} | ||
} | ||
}], | ||
"expectedBidResponses": [{"currency":"USD","bids":[]}], | ||
"expectedMakeBidsErrors": [ | ||
{ | ||
"value": "Unable to fetch mediaType for imp: some-impression-id", | ||
"comparison": "literal" | ||
} | ||
] | ||
} |
118 changes: 118 additions & 0 deletions
118
adapters/silvermob/silvermobtest/supplemental/invalid-mtype.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
|
||
{ | ||
"mockBidRequest": { | ||
"id": "some-request-id", | ||
"tmax": 1000, | ||
"user": { | ||
"buyeruid": "awesome-user" | ||
}, | ||
"app": { | ||
"id": "app_001", | ||
"bundle": "com.awesome.app", | ||
"publisher": { | ||
"id": "2" | ||
} | ||
}, | ||
"imp": [ | ||
{ | ||
"id": "some-impression-id", | ||
"tagid": "ogTAGID", | ||
"video": { | ||
"mimes": ["video/mp4"], | ||
"w": 640, | ||
"h": 480, | ||
"minduration": 120, | ||
"maxduration": 150 | ||
}, | ||
"ext": { | ||
"bidder": { | ||
"host": "eu", | ||
"zoneid": "0" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
|
||
"httpCalls": [{ | ||
"expectedRequest": { | ||
"uri": "http://eu.example.com/api/dsp/bid/0", | ||
"body": { | ||
"id": "some-request-id", | ||
"imp": [ | ||
{ | ||
"id": "some-impression-id", | ||
"tagid": "ogTAGID", | ||
"video": { | ||
"mimes": [ | ||
"video/mp4" | ||
], | ||
"minduration": 120, | ||
"maxduration": 150, | ||
"w": 640, | ||
"h": 480 | ||
}, | ||
"ext": { | ||
"bidder": { | ||
"host": "eu", | ||
"zoneid": "0" | ||
} | ||
} | ||
} | ||
], | ||
"app": { | ||
"id": "app_001", | ||
"bundle": "com.awesome.app", | ||
"publisher": { | ||
"id": "2" | ||
} | ||
}, | ||
"user": { | ||
"buyeruid": "awesome-user" | ||
}, | ||
"tmax": 1000 | ||
}, | ||
"impIDs":["some-impression-id"] | ||
}, | ||
"mockResponse": { | ||
"status": 200, | ||
"body": { | ||
"id": "awesome-resp-id", | ||
"seatbid": [ | ||
{ | ||
"bid": [ | ||
{ | ||
"id": "a3ae1b4e2fc24a4fb45540082e98e161", | ||
"impid": "some-impression-id", | ||
"price": 3.5, | ||
"adm": "awesome-markup", | ||
"adomain": [ | ||
"awesome.com" | ||
], | ||
"mtype": 8, | ||
"crid": "20", | ||
"w": 1280, | ||
"h": 720 | ||
} | ||
], | ||
"seat": "silvermob" | ||
} | ||
], | ||
"cur": "USD", | ||
"ext": { | ||
"responsetimemillis": { | ||
"silvermob": 154 | ||
}, | ||
"tmaxrequest": 1000 | ||
} | ||
} | ||
} | ||
}], | ||
"expectedBidResponses": [{"currency":"USD","bids":[]}], | ||
"expectedMakeBidsErrors": [ | ||
{ | ||
"value": "Unable to fetch mediaType for imp: some-impression-id", | ||
"comparison": "literal" | ||
} | ||
] | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Found incorrect assignment made to Bid. bid variable receives a new value in each iteration of range loop. Assigning the address of bid
(&bid)
to Bid will result in a pointer that always points to the same memory address with the value of the last iteration. This can lead to unexpected behavior or incorrect results. Refer https://go.dev/play/p/9ZS1f-5h4qSConsider using an index variable in the seatBids.Bid loop as shown below