Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add reject value when rejecting connection promise on transportClose #1870

Conversation

amiryadid-fb
Copy link
Contributor

Description

On relayer transportOpen, when waiting for provider.connect to resolve, it might get stuck so there's a Promise.race to reject the promise if transportClosed is called during connection.
In the case of rejecting it like so, the reject is called with no value which causes the catch close to throw another exception (since it tried to access message of undefined) instead of handling the current one correctly.

Due Diligence

  • Breaking change
  • Requires a documentation update
  • Related docs issue/PR (if docs are not included in this PR):
  • Requires a e2e/integration test update

@amiryadid-fb amiryadid-fb changed the title Add reject value when rejecting connection promise on transportClose fix: Add reject value when rejecting connection promise on transportClose Jan 16, 2023
@ganchoradkov ganchoradkov self-requested a review January 16, 2023 12:43
Copy link
Member

@ganchoradkov ganchoradkov left a comment

Choose a reason for hiding this comment

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

Good catch 💯 thanks for resolving this!
I'm seeing the CI is failing but that is due to no access to org ci params

@ganchoradkov ganchoradkov merged commit 3530e2b into WalletConnect:v2.0 Jan 16, 2023
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.

2 participants