consent: read the optableDisableConsent QA bypass; export a debugLog helper - #322
Merged
Conversation
…helper The optableDisableConsent flag has been declared in FLAG_KEYS since the start but nothing in the SDK read it, so integrations using the cmpapi path had no way to force permissions on for testing. getConsent() now returns full permissions and skips the CMP while the flag is set. The RTD module's private log helper moves to lib/core/log.ts and is exported alongside debugLog, an optableDebug-gated logger for wrapper code. RTD output and its enableLogging option are unchanged. PRODUCT-3971
mosherBT
force-pushed
the
consent-qa-bypass-debug-logger
branch
from
August 20, 2026 19:19
7ac3a50 to
524c094
Compare
mosherBT
marked this pull request as ready for review
August 20, 2026 19:24
mosherBT
requested review from
etiennelatendresse-optable
and removed request for
jplaroche
August 20, 2026 19:34
Contributor
|
LGTM |
etiennelatendresse-optable
approved these changes
Aug 21, 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.
Why
optableDisableConsentis declared inFLAG_KEYSbut nothing in the SDK reads it, so integrations using thecmpapipath have no way to force permissions on for QA on a page with a CMP. Debug logging similarly has no exported helper — RTD keeps an equivalent one private.What Changed
getConsent()returns full permissions and skips the CMP whileoptableDisableConsentis set.lib/core/log.tsexportingdebugLog(gated onoptableDebug) andconsoleLog(ungated, for callers with their own gating).loghelper replaced byconsoleLog; output and theenableLoggingoption unchanged.How to Test
On a GDPR page with a CMP, load with
?optableDisableConsent— an SDK built with{ consent: { cmpapi: {} } }reports all permissions granted. Without the flag, behaviour is unchanged.?optableDebugmakesdebugLogemit.Notes