Skip to content

Conversation

@jiexi
Copy link
Contributor

@jiexi jiexi commented Dec 4, 2025

Explanation

When deeplinking the user into the wallet for non-initial connection cases, the wallet has no idea which connection/session the user is opening the wallet from. In the case that the connection the dapp is using no longer exists on the wallet side, the user will sit in the wallet indefinitely waiting for a request that will never arrive.

This PR fixes that by including the connection id to the previously plain metamask://connect/mwp deeplink. It is now metamask://connect/mwp?id=CONN_ID_HERE. This will allow the wallet to prompt the user with an error toast if that connection no longer exists on the wallet side.

References

See: MetaMask/metamask-mobile#23700

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@jiexi jiexi requested a review from a team as a code owner December 4, 2025 23:04
@jiexi jiexi changed the title jl/add session id to simple deeplink feat: add session id to simple deeplinks Dec 4, 2025
@jiexi jiexi changed the title feat: add session id to simple deeplinks feat: add connection id to simple deeplinks Dec 4, 2025
Copy link
Member

@ffmcgee725 ffmcgee725 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some feedback, and also we should address the broken unit tests

@jiexi
Copy link
Contributor Author

jiexi commented Dec 5, 2025

no changelog because this is not developer or user facing

const [activeSession] = await sessionStore.list();
return activeSession;
} catch (error){
// TODO: verify if this try catch is necessary
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have we verified this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not yet. I looked at the code already, doesn't looks like this can throw, but not going to remove it out of abundance of safety

@jiexi jiexi merged commit ac9b932 into main Dec 5, 2025
40 checks passed
@jiexi jiexi deleted the jl/add-session-id-to-simple-deeplink branch December 5, 2025 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants