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

don't calculate TTR if request not found #1575

Merged
merged 1 commit into from
Sep 15, 2017

Conversation

kitwestneat
Copy link
Contributor

Type of change

  • [x ] Bugfix

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.

Copy link
Collaborator

@snapwich snapwich left a comment

Choose a reason for hiding this comment

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

has linting error

@@ -161,7 +161,10 @@ exports.addBidResponse = function (adUnitCode, bid) {
adUnitCode
});

bid.timeToRespond = bid.responseTimestamp - bid.requestTimestamp;

Copy link
Collaborator

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

@snapwich
Copy link
Collaborator

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, isValidBid() should return false.

@kitwestneat
Copy link
Contributor Author

That sounds good, I'll move the check to isValidBid()

@@ -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) {
Copy link
Member

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.

@kitwestneat
Copy link
Contributor Author

kitwestneat commented Sep 15, 2017 via email

@mkendall07
Copy link
Member

oh I missed that. Seems odd but I'm not going to touch it now. Thanks

@mkendall07 mkendall07 merged commit 8e0ce69 into prebid:master Sep 15, 2017
outoftime pushed a commit to Genius/Prebid.js that referenced this pull request Sep 18, 2017
…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
  ...
jbAdyoulike pushed a commit to jbAdyoulike/Prebid.js that referenced this pull request Sep 21, 2017
outoftime pushed a commit to Genius/Prebid.js that referenced this pull request Sep 21, 2017
* 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)
  ...
dluxemburg pushed a commit to Genius/Prebid.js that referenced this pull request Jul 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants