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: refreshing when connected to multiple namespaces only reconnects active namespace #3440

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

tomiir
Copy link
Collaborator

@tomiir tomiir commented Dec 11, 2024

Description

Currently if user is connected to multiple namespaces and refreshes the page, only the last connected connection is re-initialized.

  • Modifies storage to hold a reference to the connected connector PER NAMESPACE
  • For every namespace configured, checks storage and re-initializes connection

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

Closes APKT-1593

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

linear bot commented Dec 11, 2024

Copy link

changeset-bot bot commented Dec 11, 2024

⚠️ No Changeset found

Latest commit: e455ca3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a 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 13, 2024 1:18am
appkit-laboratory ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 1:18am
appkit-vue-solana ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 1:18am
appkit-wagmi-cdn-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 1:18am
vue-wagmi-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 1:18am

Copy link
Contributor

github-actions bot commented Dec 11, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 57.13% 15713 / 27500
🔵 Statements 57.13% 15713 / 27500
🔵 Functions 44.61% 1163 / 2607
🔵 Branches 77.05% 2210 / 2868
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/appkit/exports/constants.ts 100% 100% 100% 100%
packages/appkit/src/client.ts 18.94% 100% 0% 18.94% 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-1130, 1133-1134, 1137-1270, 1273-1299, 1302-1370, 1373-1382, 1385-1395, 1398-1477, 1480-1500, 1503-1519, 1522-1547, 1553-1574, 1577-1616, 1619-1662, 1665-1676, 1679-1691, 1697-1726, 1729-1750, 1753-1754, 1757-1766, 1769-1786, 1789-1809, 1812-1821, 1824-1840, 1843-1893, 1896-1907, 1910-1920, 1923-1939
packages/common/src/utils/SafeLocalStorage.ts 100% 100% 100% 100%
packages/core/src/controllers/ChainController.ts 84.01% 81.25% 75.38% 84.01% 73, 80, 88, 92-100, 157-158, 200-207, 212-213, 220, 238-239, 243-250, 283-285, 294-295, 298-299, 308-309, 314-315, 331-332, 384-391, 399, 433-439, 472-474, 498-499
packages/core/src/controllers/ConnectionController.ts 58.82% 78.94% 32.65% 58.82% 88, 107-137, 155-157, 161-176, 180, 184, 188, 192, 196, 200, 204, 208, 212, 216, 238-239, 247, 251, 260-266, 272-273, 111
packages/core/src/controllers/SwapController.ts 47.61% 62.85% 56.89% 47.61% 40-43, 166, 170, 178-179, 182-183, 190-191, 221-226, 252, 259-261, 270-271, 279-293, 297-309, 321, 325, 330-331, 339-342, 375, 382, 387-405, 415-417, 430-431, 442-443, 455, 462-463, 467-475, 503-504, 526-527, 541, 550-588, 592-649, 653-703, 708-759, 763-848, 865, 479-485, 864
packages/core/src/utils/CoreHelperUtil.ts 64.5% 81.33% 51.38% 64.5% 19, 23, 39, 43, 47, 58-59, 67, 90-91, 102-103, 110-111, 115-116, 126-138, 143-144, 153-157, 173-181, 201-216, 236-241, 249-254, 273, 275, 277-278, 288-293, 297-300, 310, 315, 320, 330-331, 339-348, 351-360, 114
packages/core/src/utils/SIWXUtil.ts 8.14% 100% 0% 8.14% 17, 20-56, 59-134, 137-148, 151-159, 162-173, 176-267, 270-276, 43-259
packages/core/src/utils/StorageUtil.ts 70.28% 88.67% 76.92% 70.28% 59-60, 76-79, 83-87, 102-103, 112-115, 125-126, 135-138, 147-150, 154-158, 165-166, 173-176, 183-186, 190-195, 199-203, 207-212
packages/scaffold-ui/src/partials/w3m-account-auth-button/index.ts 92.3% 83.33% 80% 92.3% 27, 63, 76-77
packages/scaffold-ui/src/partials/w3m-account-default-widget/index.ts 69.62% 74.5% 62.5% 69.62% 61-62, 70, 74-80, 87-88, 129, 151, 167, 185, 205, 225, 231-232, 248, 252-253, 256-257, 264-265, 271-272, 280, 301-305, 315, 320-321, 326-327, 334-335, 341, 345-371, 385-395, 404-405, 412-417, 420-422, 392
packages/scaffold-ui/src/utils/w3m-connecting-widget/index.ts 62.69% 23.8% 55.55% 62.69% 68-72, 80-81, 90-92, 100, 106-107, 110-111, 146-155, 173, 179-185, 189-198, 209-217
packages/scaffold-ui/src/views/w3m-account-settings-view/index.ts 85.18% 85.41% 81.25% 85.18% 53-60, 67-69, 76-77, 82-83, 150, 177, 199, 237, 254, 258-259, 267, 272-273, 281, 302-303
packages/scaffold-ui/src/views/w3m-account-view/index.ts 88.57% 100% 66.66% 88.57% 19, 25-26, 41
packages/scaffold-ui/src/views/w3m-buy-in-progress-view/index.ts 86.86% 79.41% 84.61% 86.86% 51, 59-62, 128, 134-135, 143, 157-158, 181-182, 187-188, 200-201, 206
packages/scaffold-ui/src/views/w3m-connecting-farcaster-view/index.ts 18.29% 100% 0% 18.29% 40-58, 61-64, 68-71, 75-80, 83-88, 91-104, 107-137, 140-169, 172-176, 179-215, 218-230, 233-239, 242-256, 259-270, 278-286
packages/scaffold-ui/src/views/w3m-network-switch-view/index.ts 89.74% 86.2% 88.88% 89.74% 99, 105-106, 121-122, 137-139
packages/scaffold-ui/src/views/w3m-networks-view/index.ts 95.49% 88.46% 80% 95.49% 42-43, 69, 84, 128
packages/scaffold-ui/src/views/w3m-profile-view/index.ts 17.64% 100% 0% 17.64% 39-59, 62-63, 67-118, 122-130, 133-142, 145-158, 161-172
packages/scaffold-ui/src/views/w3m-switch-address-view/index.ts 92.47% 86.95% 100% 92.47% 47, 50-53, 94, 153
packages/scaffold-ui/src/views/w3m-wallet-receive-view/index.ts 16.66% 100% 0% 16.66% 34-53, 56-57, 61-106, 110-138, 141-142, 145-153
packages/ui/src/composites/wui-list-account/index.ts 22.98% 100% 0% 22.98% 49-66, 69-84, 88-132, 137-151
packages/ui/src/composites/wui-profile-button-v2/index.ts 73.21% 28.57% 50% 73.21% 51-55, 86-92, 96-104
Generated in workflow #8104 for commit e455ca3 by the Vitest Coverage Report Action

@tomiir tomiir changed the title Fix/multichain reconnect fix: reconnecting when connected to multiple namespaces only reconnects active namespace Dec 11, 2024
@tomiir tomiir changed the title fix: reconnecting when connected to multiple namespaces only reconnects active namespace fix: refreshing when connected to multiple namespaces only reconnects active namespace Dec 11, 2024
Copy link
Collaborator

@lukaisailovic lukaisailovic left a comment

Choose a reason for hiding this comment

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

@tomiir We're missing unit tests for the scaffold-ui package. We should assert the UI changes with their respective methods (getLabel, getSubLabel etc)

@tomiir
Copy link
Collaborator Author

tomiir commented Dec 13, 2024

@lukaisailovic tested this and all other behaviors on pages I modified, think this is the approach we should take from now on to complete the testing coverage. Like any file touched requires a complete testing file.

Copy link
Collaborator

@lukaisailovic lukaisailovic left a comment

Choose a reason for hiding this comment

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

Awesome😍

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