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

Decoded string and related section data do not match as of 3.1.3 #79

Open
gilluminate opened this issue Feb 3, 2025 · 2 comments · May be fixed by #80
Open

Decoded string and related section data do not match as of 3.1.3 #79

gilluminate opened this issue Feb 3, 2025 · 2 comments · May be fixed by #80
Labels
bug Something isn't working

Comments

@gilluminate
Copy link

gilluminate commented Feb 3, 2025

When TCF is included in GPP after setSectionStringById and fireSectionChange have been called, the TCF data that is returned to a registered event listener does not reflect the updated state. However, in this situation, the TC string that is returned IS correct.

This is the exact opposite behavior of this reported bug #77 where the GPP string returned reflects an outdated state but the rest of the data (eg. parsedSection) is correct.

Oddly, the proposed fix for the bug above #78 does solve the original issue in my testing, but only partially fixes the TCF string issue. The TCF issue I describe gets reversed when that fix is applied, making the TCF data returned correct and the TC string outdated.

The 2 seem related but possibly conflicted.

@ankitonetrust
Copy link

Hello @gilluminate , Thanks for the analysis. Can you also provide steps to reproduce the issue you mentioned here about TC string?

@gilluminate
Copy link
Author

I've tried to extract it out of our Typescript code, let me know if this isn't clear or needs more context.

Before applying changes in #78:

import { CmpApi, TcfEuV2 } from "@iabgpp/cmpapi";

...
cmpApi.setSectionString(TcfEuV2.NAME, "CQMWqQAQMWqQAGXABBENBbFsAP_AAEPgAAAAKWwCwAdABcAIgAuQBkwDbAHLAQOAiuBPcCloHLQBQAuALkAZMA2wBywAAAAA");

cmpApi.fireSectionChange(TcfEuV2.NAME);

console.log(cmpApi.getGppString());
// correctly returns DBABMA~CQMWqQAQMWqQAGXABBENBbFsAP_AAEPgAAAAKWwCwAdABcAIgAuQBkwDbAHLAQOAiuBPcCloHLQBQAuALkAZMA2wBywAAAAA

const sections = cmpApi.getObject();
console.log(sections[TcfEuV2.NAME].PurposeConsents);
// incorrectly returns [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false]

After applying changes in #78:

import { CmpApi, TcfEuV2 } from "@iabgpp/cmpapi";

...
cmpApi.setSectionString(TcfEuV2.NAME, "CQMWqQAQMWqQAGXABBENBbFsAP_AAEPgAAAAKWwCwAdABcAIgAuQBkwDbAHLAQOAiuBPcCloHLQBQAuALkAZMA2wBywAAAAA");

cmpApi.fireSectionChange(TcfEuV2.NAME);

console.log(cmpApi.getGppString());
// incorrectly returns DBABMA~CQMZgE9QMZgE9GXAAAENAACAAAAAAAAAAAAAAAAAAAAA.YAAAAAAAAAAA

const sections = cmpApi.getObject();
console.log(sections[TcfEuV2.NAME].PurposeConsents);
// correctly returns [true, true, true, true, true, true, true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false]

@gilluminate gilluminate changed the title Returned TCF string and related data do not match as of 3.1.5 Decoded string and related section data do not match as of 3.1.5 Feb 14, 2025
@HeinzBaumann HeinzBaumann added the bug Something isn't working label Feb 17, 2025
@gilluminate gilluminate changed the title Decoded string and related section data do not match as of 3.1.5 Decoded string and related section data do not match as of 3.1.3 Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants