Skip to content

fix(ui+sdk): popup auth_ready — one-time signal, idempotent initAuthenticator - #602

Merged
jacoby149 merged 4 commits into
devfrom
fix/popup-auth-ready-signal
Aug 13, 2026
Merged

fix(ui+sdk): popup auth_ready — one-time signal, idempotent initAuthenticator#602
jacoby149 merged 4 commits into
devfrom
fix/popup-auth-ready-signal

Conversation

@jacoby149

Copy link
Copy Markdown
Owner

Changes

Root cause: The popup auth flow was broken by 3 compounding issues:

  1. Unresolved merge conflict markers in ui/src/interfaces/Interface.tsx (lines 195-199) — <<<<<<< HEAD, =======, >>>>>>> origin/dev in the source code
  2. Continuous broadcastinitAuthenticator sent auth_ready every 500ms via setInterval. User explicitly rejected this as "trash"
  3. Stacked listenersinitAuthenticator was called from 3 places (App.tsx popup effect, Interface.tsx authTick effect, finishLogin), each adding duplicate listeners + intervals

Fix:

  • Resolved merge conflict markers in Interface.tsx
  • Removed continuous broadcast — popup sends auth_ready once on mount
  • Made initAuthenticator idempotent with a guard flag (_authenticatorInitialized)
  • Removed redundant calls from finishLogin() and the authTick effect
  • Updated SDK comments to reflect one-time signal (not continuous)

Flow (clean, no polling):

  1. App opens popup via openAuthPortal
  2. Popup mounts → initAuthenticator runs once → sets up contract listener → sends auth_ready once
  3. SDK receives auth_ready → sends contract via postMessage
  4. Popup receives contract → shows consent screen

Files:

  • ui/src/interfaces/Interface.tsx — resolved merge conflicts, idempotent guard, removed interval
  • sdk/src/browser.ts — updated comments (one-time signal)
  • sdk/dist/browser.js — rebuilt
  • marketing/marketing-ui/public/docs/wapi.js — updated

Tests: 96 UI tests green, tsc clean, SDK build clean

@jacoby149
jacoby149 merged commit 052dcef into dev Aug 13, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant