Fix iframe cleanup after successful Link completion - #401
Conversation
|
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 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 CI is green, and the PR is mergeable pending repository approval requirements. No GitHub review was submitted. |
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.