Skip to content

Comments

fix: call close() in disconnect to reset iframe state#2434

Merged
tarrencev merged 1 commit intomainfrom
kronosapiens/fix-disconnect-iframe
Feb 20, 2026
Merged

fix: call close() in disconnect to reset iframe state#2434
tarrencev merged 1 commit intomainfrom
kronosapiens/fix-disconnect-iframe

Conversation

@kronosapiens
Copy link
Contributor

Summary

When disconnect() is called, the iframe is left in a stale post-disconnect state. On the next connect(), the existing iframe is reused (by design since v0.13.3) but the keychain doesn't render the login UI, showing a blank screen instead.

This fix calls close() after keychain disconnect, which triggers keychain.reset() via the iframe's onClose callback. This ensures the keychain is in a clean state for the next connect.

Root Cause

In v0.13.3, iframe reuse was introduced to prevent re-initialization issues when ControllerConnector is instantiated multiple times. However, disconnect() was never updated to account for the iframe now persisting across connect/disconnect cycles. The method still only cleared auth state but left the iframe's internal state stale.

Changes

  • Call this.close() in ControllerProvider.disconnect() after keychain disconnect
  • Add test verifying iframe close is called during disconnect

After disconnect, the iframe is left in a stale post-disconnect state.
When connect() is called again, it reuses the existing iframe but the
keychain doesn't render the login UI, showing a blank screen instead.

Calling close() triggers the iframe's reset via the onClose callback,
ensuring the keychain is in a clean state for the next connect().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Feb 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
controller-example-next Ready Ready Preview Feb 20, 2026 0:38am
keychain Ready Ready Preview Feb 20, 2026 0:38am
keychain-storybook Ready Ready Preview Feb 20, 2026 0:38am

Request Review

@claude
Copy link
Contributor

claude bot commented Feb 20, 2026

Claude finished @kronosapiens's task —— View job


Analyzing PR for Documentation Impact

  • Review PR changes
  • Assess user-facing impact
  • Determine documentation needs

Analysis

Change Summary:
PR #2434 fixed a bug where calling disconnect() left the keychain iframe in a stale state, causing blank screens on subsequent connect() calls. The fix adds a call to this.close() after keychain.disconnect() to properly reset iframe state.

User-facing Impact Assessment:

  • Public API unchanged - disconnect() signature remains the same
  • No new features - This is a bug fix, not new functionality
  • Expected behavior restored - Users calling disconnect() already expected proper cleanup
  • No configuration changes - No new options or parameters
  • Internal implementation detail - The iframe cleanup mechanism is not user-facing

Documentation Decision:
No documentation updates needed. This is an internal bug fix that makes existing disconnect() behavior work correctly. The documentation already correctly describes what disconnect() does (disconnects the user and clears state). The implementation detail of how it cleans up the iframe is not relevant to user-facing documentation.

Per the rules:

  1. DEFAULT TO NO CHANGES - Internal refactors and bug fixes need nothing
  2. ✅ No API changes, no behavior changes, no configuration changes
  3. ✅ Users don't need to change how they call disconnect()

The existing documentation in docs-repo/src/pages/controller/sessions.md and example files correctly shows disconnect() usage and already describes the expected behavior - this PR simply makes that behavior work correctly in all cases.


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.

2 participants