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

[DO NOT MERGE] fix: deeplink not working after connection #2882

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

magiziz
Copy link
Contributor

@magiziz magiziz commented Sep 19, 2024

Description

After connecting with a wallet on mobile deeplinks will fail when trying to sign a message or tx.
This is happening because this.appkit.getIsConnectedState() is always false. We never update it which causes wcLinking to reset and always be undefined

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

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 Sep 19, 2024

⚠️ No Changeset found

Latest commit: 83e48eb

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 Sep 19, 2024

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

Name Status Preview Updated (UTC)
appkit-laboratory ✅ Ready (Inspect) Visit Preview Sep 20, 2024 4:05pm
web3modal-gallery ✅ Ready (Inspect) Visit Preview Sep 20, 2024 4:05pm
web3modal-laboratory ✅ Ready (Inspect) Visit Preview Sep 20, 2024 4:05pm

Copy link
Contributor

github-actions bot commented Sep 19, 2024

Coverage Report for Coverage

Status Category Percentage Covered / Total
🔵 Lines 239.95999999999998% 4149 / 10429
🔵 Statements 239.95999999999998% 4149 / 10429
🔵 Functions 269.68% 322 / 805
🔵 Branches 311.29999999999995% 570 / 1047
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
packages/appkit/src/tests/mocks/AppKit.ts 100% 100% 100% 100%
packages/appkit/src/universal-adapter/client.ts 56% 47.27% 50% 56% 101-102, 137-138, 141, 146-147, 149-151, 160-163, 165-167, 169-171, 173-175, 177-182, 184, 186-195, 197, 199-202, 204-209, 211, 213, 215-218, 231-233, 242-244, 246-248, 250-253, 255-256, 282-283, 301-306, 310-315, 325, 327-330, 336-344, 346, 348-349, 366-367, 369-374, 403, 407-410, 412-413, 453-456, 458, 460, 462-464, 467-470, 474-475, 477-486, 488-489, 491-494, 532-537, 540-543, 547-548, 550-553, 555-557, 559-561, 563-570, 573-575, 577-592
Generated in workflow #6220

Copy link
Contributor

github-actions bot commented Sep 19, 2024

♻️ Vite-Size ♻️

Size Difference

Size (kb) Gzip (kb)
Total Diff. 0 0

Current Size

Name Size (kb) Gzip (kb)
assets/index-DudwSuw5.js 1867.491 533.046
assets/index.js 9.63 3.159
assets/index2.js 11.572 3.198
assets/w3m-modal.js 7.397 2.614
assets/noble-curves.js 31.941 12.778
assets/2.21.4_bufferutil.js 2.789 1.326
assets/index3.js 102.251 29.115
assets/index4.js 304.393 87.285
assets/hooks.module.js 74.443 25.589
index.html 0.329 0.236
Total Size 2412.236 698.346

Base Size

Name Size (kb) Gzip (kb)
assets/index-DudwSuw5.js 1867.491 533.046
assets/index.js 9.63 3.159
assets/index2.js 11.572 3.198
assets/w3m-modal.js 7.397 2.614
assets/noble-curves.js 31.941 12.778
assets/2.21.4_bufferutil.js 2.789 1.326
assets/index3.js 102.251 29.115
assets/index4.js 304.393 87.285
assets/hooks.module.js 74.443 25.589
index.html 0.329 0.236
Total Size 2412.236 698.346

Comment on lines +417 to +429
if (this.appKit?.getCaipAddress() && !this.appKit?.getIsConnectedState()) {
this.appKit?.setIsConnected(true, this.appKit?.getActiveChainNamespace() || 'eip155')
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wish i could put this logic in a handler, but we're syncing account before listening to our handlers.

I tried to refactor it so it's the other way around, but that introduces more issues.

@magiziz magiziz force-pushed the fix/walletconnect-deeplink-failure branch from 8738ceb to 83e48eb Compare September 20, 2024 17:08
@magiziz magiziz changed the title fix: deeplink not working after connection [DO NOT MERGE] fix: deeplink not working after connection Sep 20, 2024
@magiziz
Copy link
Contributor Author

magiziz commented Sep 20, 2024

Seems like something that got merged in main broke this PR

@magiziz magiziz force-pushed the fix/walletconnect-deeplink-failure branch 2 times, most recently from 8738ceb to 83e48eb Compare September 20, 2024 17:23
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.

1 participant