-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
don't calculate TTR if request not found #1575
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.
has linting error
src/bidmanager.js
Outdated
@@ -161,7 +161,10 @@ exports.addBidResponse = function (adUnitCode, bid) { | |||
adUnitCode | |||
}); | |||
|
|||
bid.timeToRespond = bid.responseTimestamp - bid.requestTimestamp; | |||
|
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 extra newline is causing a linter error and failing the build
other than the linting error this LGTM. However, I'm wondering if we should be throwing this bid out even earlier if it isn't part of the current auction. It seems to me if it's not a valid bid for this current auction, |
That sounds good, I'll move the check to isValidBid() |
1151024
to
1797293
Compare
Update tests to match.
1797293
to
622aacf
Compare
@@ -109,6 +109,13 @@ exports.addBidResponse = function (adUnitCode, bid) { | |||
utils.logError(errorMessage('No adUnitCode was supplied to addBidResponse.')); | |||
return false; | |||
} | |||
|
|||
const bidRequest = getBidderRequest(bid.bidderCode, adUnitCode); | |||
if (!bidRequest.start) { |
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.
if you trying to check for no bid request, I think this condition should be just if (!bidRequest)
otherwise you'll get an undefined error.
Currently, getBidderRequest returns { start: null, requestId: null } if it
can't find a valid request. I agree that have getBidderRequest return
undefined or false makes more sense though.
…On Fri, Sep 15, 2017 at 7:36 AM, Matt Kendall ***@***.***> wrote:
***@***.**** requested changes on this pull request.
------------------------------
In src/bidmanager.js
<#1575 (comment)>:
> @@ -109,6 +109,13 @@ exports.addBidResponse = function (adUnitCode, bid) {
utils.logError(errorMessage('No adUnitCode was supplied to addBidResponse.'));
return false;
}
+
+ const bidRequest = getBidderRequest(bid.bidderCode, adUnitCode);
+ if (!bidRequest.start) {
if you trying to check for no bid request, I think this condition should
be just if (!bidRequest) otherwise you'll get an undefined error.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1575 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANGyQ-UF_Fj31rfQcoVYdphsByteVwZks5simEggaJpZM4PTjN2>
.
|
oh I missed that. Seems odd but I'm not going to touch it now. Thanks |
…built * 'master' of https://github.com/prebid/Prebid.js: (46 commits) Serverbid alias (prebid#1560) Add user sync to process for approving adapter PRs (prebid#1457) fix travis build (prebid#1595) Rubicon project improvement/user sync (prebid#1549) Adding Orbitsoft adapter (prebid#1378) Fix renderer test for new validation rule (prebid#1592) Allow SET_TARGETING to be used in AnalyticsAdapter (prebid#1577) Add support for video stream context (prebid#1483) Invalidate bid if matching bid request not found (prebid#1575) allow adapters to set default adserverTargeting for specific bid (prebid#1568) Custom granularity precision should honor 0 if it is passed in closes prebid#1479 (prebid#1591) BaseAdapter for the Prebid 0.x -> 1.x transition (prebid#1494) Add a version to the Criteo adapter (prebid#1573) Allow bundling from node.js or with new gulp task bundle-to-stdout (prebid#1570) Add url.parse option to not decode the whole URL (prebid#1480) Tremor Video Bid Adapter (prebid#1552) Yieldmo bid adapter (prebid#1415) Switch `gulp docs` to build its output using documentation.js (prebid#1545) Increment pre version Prebid 0.28.0 Release ...
Update tests to match.
* tag '0.29.0' of https://github.com/prebid/Prebid.js: (29 commits) Prebid 0.29.0 Release Fix for not syncing bidders. (prebid#1598) fix amp example pages (prebid#1597) closes prebid#1298 (prebid#1583) Fixed the broken tests. (prebid#1602) Rubicon Bidder Factory (prebid#1587) Trustx adapter (prebid#1488) Add nurl to markup (prebid#1601) Pass bidRequest to createBid (prebid#1600) Add Kumma adapter (prebid#1512) Serverbid alias (prebid#1560) Add user sync to process for approving adapter PRs (prebid#1457) fix travis build (prebid#1595) Rubicon project improvement/user sync (prebid#1549) Adding Orbitsoft adapter (prebid#1378) Fix renderer test for new validation rule (prebid#1592) Allow SET_TARGETING to be used in AnalyticsAdapter (prebid#1577) Add support for video stream context (prebid#1483) Invalidate bid if matching bid request not found (prebid#1575) allow adapters to set default adserverTargeting for specific bid (prebid#1568) ...
Update tests to match.
Type of change
Description of change
If the bidrequest can't be found, for example on a very late bid, don't try to calculate TTR. If the start time
is 0, then TTR will be huge and the current auction will immediately timeout.