fix(ui+sdk): popup auth_ready — one-time signal, idempotent initAuthenticator - #602
Merged
Conversation
…, demos send contract from login button click
…nticator, resolved merge conflicts
…step from openAuthPortal through contract exchange to goToApp
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.
Changes
Root cause: The popup auth flow was broken by 3 compounding issues:
ui/src/interfaces/Interface.tsx(lines 195-199) —<<<<<<< HEAD,=======,>>>>>>> origin/devin the source codeinitAuthenticatorsentauth_readyevery 500ms viasetInterval. User explicitly rejected this as "trash"initAuthenticatorwas called from 3 places (App.tsx popup effect, Interface.tsx authTick effect, finishLogin), each adding duplicate listeners + intervalsFix:
auth_readyonce on mountinitAuthenticatoridempotent with a guard flag (_authenticatorInitialized)finishLogin()and the authTick effectFlow (clean, no polling):
openAuthPortalinitAuthenticatorruns once → sets up contract listener → sendsauth_readyonceauth_ready→ sends contract via postMessageFiles:
ui/src/interfaces/Interface.tsx— resolved merge conflicts, idempotent guard, removed intervalsdk/src/browser.ts— updated comments (one-time signal)sdk/dist/browser.js— rebuiltmarketing/marketing-ui/public/docs/wapi.js— updatedTests: 96 UI tests green, tsc clean, SDK build clean