You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One bit for each Purpose:
1 Consent
0 No Consent
The user’s consent value for each Purpose established on the legal basis of consent.
The Purposes are numerically identified and published in the Global Vendor List. From left to right, Purpose 1 maps to the 0th bit, purpose 24 maps to the bit at index 23. Special Purposes are a different ID space and not included in this field.
The encoding change matches the specification.
The spec defines bit 0 as ID 1, bit 1 as ID 2, and so on. The change from containsInt(i) to containsInt(i + 1) correctly aligns encoding with the existing decode behavior. This is not a spec issue.
Actual bug: the last valid ID cannot be stored through the API. EncodableFixedBitfield.initialize() creates the IntegerSet with adjustment = 0 and to = numElements, so the set only accepts IDs 0..numElements-1. After the encoding fix, the valid IDs are 1..numElements.
Example:
For Bitfield(24), IDs 1..23 work, but ID 24 is rejected by IntegerSet.addInt() and is never stored. Therefore, Purpose 24 cannot be set through setFieldValue().
Recommended fix:
Initialize the set with adjustment = 1:
The same boundary check should be added for Bitfield(12) so Special Feature Opt-In ID 12 also survives setFieldValue().
Main point: PR 108 is spec-correct on bit indexing; the remaining issue is an off-by-one storage bug that prevents the highest valid ID from being set.
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
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.
this addresses the feedback done in #83 (comment)
from one of the tcf specs: