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

Update Vast logic #1271

Merged
merged 7 commits into from
Jun 4, 2021
Merged

Update Vast logic #1271

merged 7 commits into from
Jun 4, 2021

Conversation

SerhiiNahornyi
Copy link
Collaborator

No description provided.

Serhii Nahornyi added 2 commits May 18, 2021 03:00
# Conflicts:
#	src/test/resources/org/prebid/server/it/openrtb2/rubicon_appnexus/test-auction-rubicon-appnexus-response.json
final String impressionUrl = "<![CDATA[" + vastUrlTracking + "]]>";
final String openTag = "<Impression>";
final String impressionTag = "<Impression><![CDATA[" + vastUrlTracking + "]]></Impression>";
final String inlineCloseTag = IN_LINE_TAG.replace("<", "</");
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a constant actually, there is no need to create a new string for each invocation.

}

private String appendTrackingUrlForWrapperType(String vastXml, String vastUrlTracking, Integer wrapperTagIndex) {
final String impressionTag = "<Impression><![CDATA[" + vastUrlTracking + "]]></Impression>";
Copy link
Contributor

Choose a reason for hiding this comment

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

Impression tag construction looks similar across this and previous methods and is a good candidate for a separate method.


return vastXml.replaceFirst(closeTag, closeTag + openTag + impressionUrl + closeTag);
return vastXml.replaceFirst(WRAPPER_TAG, WRAPPER_TAG + impressionTag);
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be technically correct but still causes itching somehow. Can we insert impression tag in wrapper after the last present impression to be in line with how it is done in inline object?

Serhii Nahornyi added 3 commits June 1, 2021 23:24
# Conflicts:
#	src/main/java/org/prebid/server/auction/BidResponseCreator.java
#	src/test/resources/org/prebid/server/it/openrtb2/rubicon_appnexus/test-auction-rubicon-appnexus-response.json
@@ -163,6 +163,7 @@ private static int validateTruncateAttrChars(int truncateAttrChars) {
AuctionContext auctionContext,
BidRequestCacheInfo cacheInfo,
Map<String, MultiBidConfig> bidderToMultiBids,
List<String> debugWarnings,
Copy link
Contributor

Choose a reason for hiding this comment

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

This parameter doesn't look necessary - debugWarnings could be obtained from auctionContext

return appendTrackingUrl(vastXml, vastUrlTracking, false);
}
metrics.updateAdapterRequestErrorMetric(bidder, MetricName.badserverresponse);
if (debugWarnings != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

From what I see debugWarnings shouldn't be null ever.

@rpanchyk rpanchyk merged commit 5a3dccb into master Jun 4, 2021
@rpanchyk rpanchyk deleted the vast/modify/update branch June 4, 2021 14:07
nickluck9 pushed a commit that referenced this pull request Aug 9, 2021
nickluck9 pushed a commit that referenced this pull request Aug 10, 2021
nickluck9 pushed a commit that referenced this pull request Aug 10, 2021
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