Fix: Valid CCPA consent was dropped when gdpr_applies=true - #4900
Open
karwaankit32 wants to merge 2 commits into
Open
Fix: Valid CCPA consent was dropped when gdpr_applies=true#4900karwaankit32 wants to merge 2 commits into
karwaankit32 wants to merge 2 commits into
Conversation
przemkaczmarek
previously approved these changes
Aug 13, 2026
anishb-ms
reviewed
Aug 14, 2026
| errorMsgs: []string{"Consent string 'XXXX' is not a valid CCPA consent string."}, | ||
| }, | ||
| }, | ||
| } |
Contributor
There was a problem hiding this comment.
Both of these test cases in amp_auction_test.go set ConsentType: amp.ConsentUSPrivacy. The default: branch of ReadPolicy (unset consent_type, i.e. ConsentType == 0) is also affected by the fix but untested. Add a case that omits ConsentType (defaults to 0 → default branch):
{
desc: "amp.Params default consent_type with valid CCPA consent and gdpr_applies true - expect consent warning and remaining overrides applied",
given: testInput{
ampParams: amp.Params{
Consent: "1YNN",
// ConsentType intentionally unset -> auto-detect (default branch)
GdprApplies: &gdprApplies,
Targeting: `{"foo":"bar"}`,
Timeout: &timeout,
Trace: "verbose",
},
bidRequest: &openrtb2.BidRequest{
Imp: []openrtb2.Imp{{Banner: &openrtb2.Banner{Format: []openrtb2.Format{}}}},
},
},
expected: testOutput{
bidRequest: &openrtb2.BidRequest{
Imp: []openrtb2.Imp{{
Banner: &openrtb2.Banner{Format: []openrtb2.Format{}},
Ext: json.RawMessage(`{"data":{"foo":"bar"}}`),
}},
Regs: &openrtb2.Regs{USPrivacy: "1YNN"},
Site: &openrtb2.Site{Ext: json.RawMessage(`{"amp":1}`)},
TMax: 500,
Ext: json.RawMessage(`{"prebid":{"trace":"verbose"}}`),
},
errorMsgs: []string{"AMP request gdpr_applies value was ignored because provided consent string is a CCPA consent string"},
},
},
przemkaczmarek
approved these changes
Aug 17, 2026
anishb-ms
approved these changes
Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixing bug - #4867