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

GPP Consent Module Re-Uses Errored CMP Client #10810

Closed
evans-sam opened this issue Dec 7, 2023 · 0 comments · Fixed by #10811
Closed

GPP Consent Module Re-Uses Errored CMP Client #10810

evans-sam opened this issue Dec 7, 2023 · 0 comments · Fixed by #10811
Labels

Comments

@evans-sam
Copy link

evans-sam commented Dec 7, 2023

Type of issue

Question, Bug

Description

The GPP Consent Module appears to re-use the errored state of the cmp client instead of look searching again. This seems to be unexpected behavior

static init(mkCmp = cmpClient) {
if (this.INST == null) {
this.INST = this.ping(mkCmp).catch(e => {
this.INST = null;
throw e;
});
}
return this.INST.then(([client, pingData]) => [
client,
client.initialized ? client.refresh() : client.init(pingData)
]);
}

it('should not re-use errors', (done) => {
cmpResult = Promise.reject(new Error());
GPPClient.init(makeCmp).catch(() => {
cmpResult = {signalStatus: 'ready'};
return GPPClient.init(makeCmp).then(([client]) => {
expect(client).to.exist;
done()
})
})
})
})

Steps to reproduce

Initialize pbjs and request bids before a cmp is loaded. Try again after the cmp as loaded. The test page attempts to run an auction, then loads the stub cmp, and tries again. When debugging, the gpp module does not try to initialize a new cmp client and just throws the previous error

Test page

https://jsfiddle.net/u2dqnh8v/

Expected results

the gpp module searches for the cmp again, the way gdpr and usp seem to work

Actual results

Platform details

latest version of prebid, Chrome and Firefox

Other information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging a pull request may close this issue.

2 participants