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

Fix: Inject default DSA before auction request is rebuilt #3639

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

bsardo
Copy link
Collaborator

@bsardo bsardo commented Apr 24, 2024

In v2.15.0, #3540 was added which would inject a default DSA into the auction request prior to splitting it into bid requests. This was done using the request wrapper and a new call was made to the wrapper RebuildRequest function to sync the underlying BidRequest object with the wrapper ext objects that may have been modified by PBS-Core. All of this was happening within the exchange cleanOpenRTBRequests function. This change introduced a bug in the stored bid response logic which runs in cleanOpenRTBRequests and works by removing any impressions from the original bid request that map to a stored bid response. RebuildRequest should not be called after this bid response logic as by the time cleanOpenRTBRequests runs, the assumption is that all modifications to the auction request by PBS-Core are complete and the wrapper is in sync.
As a result, the default DSA logic and the GDPR logic required to determine whether to write the default DSA has been moved up a level prior to a preexisting RebuildRequest call intended to sync the wrapper after modifications by PBS-Core and before the call to `cleanOpenRTBRequests.

Regarding the test changes made here, I deleted a bunch of test cases in TestCleanOpenRTBRequestsGDPR as they are no longer applicable now that gdprEnforced is computed a level above. The deleted test cases were testing that the proper priority was being given to the account vs host gdpr enabled configurations when calculating gdprEnforced. We shouldn't need additional test cases in the exchange even though the logic was moved there because this logic should be adequately tested via unit test in gdpr/aggregated_config_test.go#TestIntegrationEnabled.
And we also already have a couple of exchange JSON tests that verify the logic is executed. Some of those GDPR JSON tests, exchange/exchangetest/gdpr-*.json, set the host config gdpr enabled flag.

Copy link
Collaborator

@hhhjort hhhjort left a comment

Choose a reason for hiding this comment

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

LGTM

@bsardo bsardo merged commit ecb50e7 into prebid:master Apr 25, 2024
3 checks passed
@bsardo bsardo mentioned this pull request Apr 25, 2024
if err != nil {
return nil, err
}
channelEnabled := r.TCF2Config.ChannelEnabled(channelTypeMap[r.LegacyLabels.RType])
Copy link

@scr-oath scr-oath May 31, 2024

Choose a reason for hiding this comment

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

This causes panic for the /openrtb2/video endpoint now.

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please share a stack trace?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, nevermind, A pull request to fix it is better,. :)

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.

5 participants