Repository navigation
fix(provider): resolve logout when connected through Magic Widget - #1137
Open
RaphaelFakhri wants to merge 1 commit into
Open
RaphaelFakhri wants to merge 1 commit into
RaphaelFakhri wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📦 Pull Request
ThirdPartyWalletsModule.magicWidgetLogout()returned the overlay request from itscreatePromiEventexecutor but never calledresolve.createPromiseuses 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
resolveand its error toreject, which matchesrequestThirdPartyWallets()inbase-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
magic.user.logout()never resolves when connected through Magic Widget (Wallet Kit) #1136🚨 Test instructions
cd packages/@magic-sdk/provider TS_NODE_PROJECT=./test/tsconfig.json npx jest test/spec/modules/third-party-walletWithout 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.patch: Bug Fix