-
Notifications
You must be signed in to change notification settings - Fork 84
ENG-2122 Embedded constant (TCF on mobile SDK) white screen #7065
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
Conversation
…bedded mode The delay banner effect used `!disableBanner` to check if the banner should open. Since `disableBanner` starts as `null`, and `!null === true` in JavaScript, if the 100ms timeout fired before the state was updated from `null` to `true`, it would incorrectly call `setBannerIsOpen(true)`. In embedded mode, setting `bannerIsOpen` to `true` causes the ConsentContent to be replaced with `null`, resulting in a white screen. This was more likely to occur on mobile devices with slower JavaScript execution. The fix uses an explicit `=== false` check to ensure the banner only opens when we've definitively determined it should (not when still initializing).
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
Greptile OverviewGreptile SummaryFixed a race condition in the consent banner that could cause a white screen in embedded mode on mobile SDK. The issue occurred when Key changes:
Confidence Score: 5/5
Important Files ChangedFile Analysis
|
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.
2 files reviewed, no comments
gilluminate
left a comment
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.
Makes sense
Ticket ENG-2122
Description Of Changes
Small fix in an attempt to prevent a white screen on CN in the mobile SDK
Code Changes
The bug:
disableBanner starts as null
The delay banner effect checks if (!disableBanner)
!null === true in JavaScript
If the 100ms timeout fires before disableBanner is updated from null to true, it calls setBannerIsOpen(true)
In embedded mode, bannerIsOpen === true causes ConsentContent to be replaced with null (line 293)
White screen!
Steps to Confirm
Pre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works