Skip to content

fix(provider): resolve logout when connected through Magic Widget - #1137

Open
RaphaelFakhri wants to merge 1 commit into
magiclabs:masterfrom
RaphaelFakhri:bug/provider/magic-widget-logout-never-resolves
Open

RaphaelFakhri wants to merge 1 commit into
magiclabs:masterfrom
RaphaelFakhri:bug/provider/magic-widget-logout-never-resolves

Conversation

@RaphaelFakhri

Copy link
Copy Markdown

📦 Pull Request

ThirdPartyWalletsModule.magicWidgetLogout() returned the overlay request from its createPromiEvent executor but never called resolve. createPromise uses the executor's return value only to catch errors, so a successful logout left the promise pending forever. As a result, magic.user.logout() never resolved for users connected through the Magic Widget (@magic-ext/wallet-kit).

This change forwards the overlay request's result to resolve and its error to reject, which matches requestThirdPartyWallets() in base-module.ts. Wallet Kit state is still cleared before the request, and a failure to clear it is still logged without blocking logout.

A new spec, test/spec/modules/third-party-wallet/magicWidgetLogout.spec.ts, covers the success, failure and "clearing Wallet Kit state throws" paths.

✅ Fixed Issues

🚨 Test instructions

cd packages/@magic-sdk/provider
TS_NODE_PROJECT=./test/tsconfig.json npx jest test/spec/modules/third-party-wallet

Without the source change, the success and "clearing state throws" tests fail with Exceeded timeout of 30000 ms. With it, all 16 tests in the folder pass, and the full provider suite passes (440 passed, 6 skipped) with coverage above the thresholds.

⚠️ Don't forget to add a semver label!

  • patch: Bug Fix

@RaphaelFakhri
RaphaelFakhri requested a review from a team October 24, 2026 19:51

This branch has not been deployed

No deployments
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.

magic.user.logout() never resolves when connected through Magic Widget (Wallet Kit)

1 participant