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

refactor: disconnect logic and state update for multiple adapter use cases #3460

Conversation

enesozturk
Copy link
Contributor

@enesozturk enesozturk commented Dec 13, 2024

Description

  • Refactors's disconnect functionality to make sure it's calling the connectionController's disconnect method
    • Moves all adapters iteration from adapter specific code (from appkit/client to ChainController)
  • Makes sure it's removing account and network data for each adapter

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-xxx
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

vercel bot commented Dec 13, 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 13, 2024 2:07pm
appkit-laboratory ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 2:07pm
appkit-vue-solana ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 2:07pm
appkit-wagmi-cdn-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 2:07pm
vue-wagmi-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 2:07pm

Copy link

changeset-bot bot commented Dec 13, 2024

🦋 Changeset detected

Latest commit: 9c550b3

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

This PR includes changesets to release 18 packages
Name Type
@reown/appkit Patch
@reown/appkit-core 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-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

@enesozturk enesozturk changed the title enes/apkt 1685 when have multiple adapters disconnect method is not refactor: disconnect logic and state update for multiple adapter use cases Dec 13, 2024
Copy link
Contributor

github-actions bot commented Dec 13, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 53.97% 14794 / 27411
🔵 Statements 53.97% 14794 / 27411
🔵 Functions 40.8% 1063 / 2605
🔵 Branches 75.31% 1882 / 2499
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/appkit/src/client.ts 19.13% 100% 0% 19.13% 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-732, 735-746, 749-769, 772-778, 781-790, 793-1122, 1125-1126, 1129-1261, 1264-1290, 1293-1361, 1364-1373, 1376-1386, 1389-1467, 1470-1490, 1493-1504, 1507-1532, 1538-1559, 1562-1601, 1604-1647, 1650-1661, 1664-1676, 1679-1719, 1722-1723, 1726-1735, 1738-1755, 1758-1778, 1781-1790, 1793-1809, 1812-1862, 1865-1876, 1879-1889, 1892-1908
packages/core/src/controllers/ChainController.ts 83.29% 76.08% 74.62% 83.29% 73-75, 81, 89, 93-101, 158-159, 201-208, 213-214, 221, 239-240, 244-251, 284-286, 295-296, 299-300, 309-310, 315-316, 332-333, 338-339, 351-352, 385-392, 400, 432-438, 451-452, 471-473, 497-498, 556
packages/core/src/controllers/ConnectionController.ts 57.92% 73.33% 32.65% 57.92% 88, 104-134, 152-153, 157-172, 176, 180, 184, 188, 192, 196, 200, 204, 208, 212, 234-235, 243, 247, 254-260, 264-265, 108
Generated in workflow #8113 for commit b1f06bf by the Vitest Coverage Report Action

@enesozturk enesozturk merged commit 444d1dd into main Dec 13, 2024
19 checks passed
@enesozturk enesozturk deleted the enes/apkt-1685-when-have-multiple-adapters-disconnect-method-is-not branch December 13, 2024 14:18
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.

3 participants