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

Fixed panic when connectionType is not available in request #901

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion modules/pubmatic/openwrap/beforevalidationhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,13 @@ func (m OpenWrap) handleBeforeValidationHook(
m.metricEngine.RecordReqImpsWithContentCount(rCtx.PubIDStr, models.ContentTypeSite)
}
}
videoAdUnitCtx = adunitconfig.UpdateVideoObjectWithAdunitConfig(rCtx, imp, div, payload.BidRequest.Device.ConnectionType)

var connectionType *adcom1.ConnectionType
if payload.BidRequest.Device != nil && payload.BidRequest.Device.ConnectionType != nil {
connectionType = payload.BidRequest.Device.ConnectionType
}

videoAdUnitCtx = adunitconfig.UpdateVideoObjectWithAdunitConfig(rCtx, imp, div, connectionType)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are we using connectionType in UpdateVideoObjectWithAdunitConfig() ?

I see code is commented

Copy link
Collaborator

Choose a reason for hiding this comment

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

I can see the code to disable video if incoming request connection type is not present in allowed connection types from config is commented.
@pm-nikhil-vaidya Can we please check why this functionality is commented? It is present in the header-bidding repo.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, will check the usage and remove the code block if there no use of the code.
I will address this with another PR

if rCtx.Endpoint == models.EndpointAMP && m.pubFeatures.IsAmpMultiformatEnabled(rCtx.PubID) && isVideoEnabledForAMP(videoAdUnitCtx.AppliedSlotAdUnitConfig) {
//Iniitalized local imp.Video object to update macros and get mappings in case of AMP request
rCtx.AmpVideoEnabled = true
Expand Down
Loading