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 rainbow wallet unable to reconnect issue #3439

Merged
merged 18 commits into from
Dec 11, 2024
Merged

Conversation

svenvoskamp
Copy link
Contributor

@svenvoskamp svenvoskamp commented Dec 11, 2024

Description

In some cases with wagmi connectors, the connector is already connected but wagmi state is out of sync. It will throw an connector is already connected error. In such cases, we need to reconnect to restore the session. I added functionality for this in this PR

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Associated Issues

For Linear issues: Closes APKT-1714 https://linear.app/reown/issue/APKT-1714/[bug]-rainbow-wallet-fails-to-connect
For GH issues: closes #...

Showcase (Optional)

If there is a UI change include the screenshots with before and after state.
If new feature is being introduced, include the link to demo recording.

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

Copy link

changeset-bot bot commented Dec 11, 2024

🦋 Changeset detected

Latest commit: 97c644f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 19 packages
Name Type
@reown/appkit Patch
@apps/builder Patch
@reown/appkit-adapter-ethers Patch
@reown/appkit-adapter-ethers5 Patch
@reown/appkit-adapter-solana Patch
@reown/appkit-adapter-wagmi Patch
@reown/appkit-utils Patch
@reown/appkit-cdn Patch
@reown/appkit-cli Patch
@reown/appkit-common Patch
@reown/appkit-core Patch
@reown/appkit-experimental Patch
@reown/appkit-polyfills Patch
@reown/appkit-scaffold-ui Patch
@reown/appkit-siwe Patch
@reown/appkit-siwx Patch
@reown/appkit-ui Patch
@reown/appkit-wallet Patch
@reown/appkit-wallet-button Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Dec 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
appkit-builder ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 11, 2024 4:55pm
appkit-laboratory ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 11, 2024 4:55pm
appkit-vue-solana ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 11, 2024 4:55pm
appkit-wagmi-cdn-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 11, 2024 4:55pm
vue-wagmi-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 11, 2024 4:55pm

@svenvoskamp svenvoskamp changed the title Fix/rainbow reconnect :fix rainbow wallet unable to reconnect issue Dec 11, 2024
Copy link
Contributor

github-actions bot commented Dec 11, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 52.94% 14490 / 27368
🔵 Statements 52.94% 14490 / 27368
🔵 Functions 39.8% 1035 / 2600
🔵 Branches 75.11% 1796 / 2391
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/appkit/src/client.ts 19.1% 100% 0% 19.1% 186-193, 196-197, 200-235, 239-241, 244-246, 249-250, 254-255, 258-259, 262-271, 274-277, 280-283, 286-287, 290-291, 294-295, 298-300, 303-304, 307-308, 311-313, 316-317, 320-321, 324-335, 338-347, 350-351, 354-355, 358-359, 362-363, 366-367, 370-371, 374-375, 378-379, 382-383, 386-387, 390-391, 394-395, 398-399, 402-403, 406-409, 614-615, 618-621, 624-625, 628-629, 632-633, 636-637, 640-641, 645-728, 731-742, 745-765, 768-774, 777-786, 789-1126, 1129-1130, 1133-1265, 1268-1294, 1297-1365, 1368-1377, 1380-1390, 1393-1471, 1474-1494, 1497-1508, 1511-1536, 1542-1563, 1566-1605, 1608-1651, 1654-1665, 1668-1680, 1683-1723, 1726-1727, 1730-1739, 1742-1759, 1762-1782, 1785-1794, 1797-1813, 1816-1866, 1869-1880, 1883-1893, 1896-1912
Generated in workflow #8047 for commit 97c644f by the Vitest Coverage Report Action

Copy link

linear bot commented Dec 11, 2024

* We check if the reconnect method exists (which it does for wagmi connectors) and if so
* we attempt to reconnect and restore the session state.
*/
} catch (error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

error needed here?

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