-
Notifications
You must be signed in to change notification settings - Fork 142
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
consent: handle cases where show banner is unchecked #987
Conversation
|
8fce3aa
to
431ad2b
Compare
if ('geolocationResponse' in oneTrust) { | ||
return undefined | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry - I'm having a little trouble understanding this bit.
window.OneTrust
can be different objects depending on some conditions? Does it become the OneTrust object we know only after the banner is interacted with, or after something outside our control is loaded?
The comment about polling a few lines down confused me a bit too...when does this happen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
window.OneTrust can be different objects depending on some conditions?
Correct. I think if the show banner checkbox is false (or maybe some other condition in the template I used), it will have a moment before it fully initialized where it just has the geolocation property.
Manual testing was the only reason I noticed that. Likely undocumented, but made me realize that this object is unreliable and I'd rather we not throw if it cycles through different shapes.
The comment about polling a few lines down confused me a bit too...when does this happen?
See the usage of "resolveWhen" for when we poll for the OneTrust global. My meaning is: because we are polling the object, we have the chance of hitting one of those intermediate states, so, when used in resolveWhen, we wait for every method we depend on to exist before we actually return the global. If undefined, it continues to poll.
I decided to log an error vs throw because, well, my confidence is shaken: it's possible that there is some intermediate state(s) we don't know about that a customer (or us) will discover --- and OneTrust still gets a chance to initialize correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
possible that there is some intermediate state(s) we don't know about that a customer (or us) will discover
Yeah, that seems reasonable to log then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ('geolocationResponse' in oneTrust) { | ||
return undefined | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
possible that there is some intermediate state(s) we don't know about that a customer (or us) will discover
Yeah, that seems reasonable to log then.
#972
Fix bug: if showAlertNotice is false and Segment has default categories, we want to immediately load Segment with any default categories.
This PR mantains the status quo when it comes to end user re-consent / updated consent (consent updates made after the initial consent decision, in this case, any decision where the end user toggles the alert box on again.)
^ This will come in later PRs / work