Skip to content

Fix iframe cleanup after successful Link completion - #401

Merged
phoenixy1 merged 2 commits into
masterfrom
fix/cleanup-link-after-success
Jul 23, 2026
Merged

Fix iframe cleanup after successful Link completion#401
phoenixy1 merged 2 commits into
masterfrom
fix/cleanup-link-after-success

Conversation

@phoenixy1

@phoenixy1 phoenixy1 commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Successful Link completion left the wrapper marked open, so unmount cleanup waited for an exit callback that would never arrive. Marking the instance closed in the success callback lets cleanup destroy the iframe immediately and includes regression coverage.

Closes #325.

@phoenixy1
phoenixy1 requested a review from wkiefer July 22, 2026 20:43
@phoenixy1

phoenixy1 commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator Author

Review from codex:

• No blocking findings. I’d approve PR #401.

The lifecycle fix in src/factory.ts:55 is sound: onSuccess marks the handler closed, preserves callback delegation, and allows unmount cleanup to destroy the iframe immediately. This matches Plaid’s documented callback semantics: onSuccess
indicates completion, while onExit covers unsuccessful exits or initialization errors. Link Web documentation (https://plaid.com/docs/link/web/)

One non-blocking test improvement: after invoking plaidConfig.onSuccess, assert that the consumer’s config.onSuccess received the original token and metadata. The wrapper now mediates that callback, but the regression test only verifies
cleanup.

CI is green, and the PR is mergeable pending repository approval requirements. No GitHub review was submitted.

@phoenixy1
phoenixy1 merged commit 2ead8c1 into master Jul 23, 2026
1 check 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.

Plaid link iframe is not removed

2 participants