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

test: try fix ci issue by mock coinbase sdk #668

Merged
merged 5 commits into from
Mar 21, 2024

Conversation

jeasonstudio
Copy link
Collaborator

[中文版模板 / Chinese template]

📝 Git Commit Message Convention

This is adapted from Angular's commit convention.

🔗 Related issue link

尝试处理 @coinbase/wallet-sdk 内部包导致的 websocket error

Copy link

changeset-bot bot commented Mar 19, 2024

⚠️ No Changeset found

Latest commit: 6c56e95

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

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

Name Status Preview Comments Updated (UTC)
ant-design-web3 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 20, 2024 10:42am

Copy link

github-actions bot commented Mar 19, 2024

Copy link

codecov bot commented Mar 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (4204e42) to head (6c56e95).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #668   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          650       650           
  Lines        17505     17505           
  Branches      1071      1071           
=========================================
  Hits         17505     17505           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jeasonstudio jeasonstudio marked this pull request as ready for review March 19, 2024 09:11
@thinkasany
Copy link
Collaborator

thinkasany commented Mar 19, 2024

我本地也会出现一个快照错误,看了一下ci也有

https://github.com/ant-design/ant-design-web3/actions/runs/8340142264/job/22824624200

image

image

看起来似乎是pr刚新增的另外一个修改的文件,这个有什么特殊的用处么,还是还没update @jeasonstudio

image

@jeasonstudio
Copy link
Collaborator Author

@thinkasany 还原了,不过即使 snapshot fail 了 ci 也还是成功的,有点怪

@jeasonstudio
Copy link
Collaborator Author

还是会出现 websocket error,我先 convert to draft 了

@jeasonstudio
Copy link
Collaborator Author

已知的错误触发链路:

  • wagmi coinbaseWallet connector: coinbaseWallet({})
  • await import('@coinbase/wallet-sdk') => new SDK() => sdk.makeWeb3Provider()
  • new CoinbaseWalletProvider() => new WLRelayAdapter() => getQRCodeUrl() => new WalletLinkConnection()
  • WalletLinkConnection 这个连接类实例化时会尝试建立 ws connection,触发了 ci 环境下的 uncaught error

@jeasonstudio
Copy link
Collaborator Author

testcase 里去掉 coinbase wallet

@jeasonstudio
Copy link
Collaborator Author

CoinbaseWallet SDK 实例化的时候就会尝试去跟官方的一个 rpc 地址建立 ws 连接,在 CI 环境会出现各种问题,而且这是一个动态引入的内部依赖包,不太好用 vi.mock 去绕过。
目前是移除了所有非必需的 coinbaseWallet,在移除不掉的地方套了 try/catch

@yutingzhao1991 @thinkasany

@jeasonstudio jeasonstudio merged commit d374e55 into main Mar 21, 2024
12 checks passed
@jeasonstudio jeasonstudio deleted the fix-websocket-issue-ci branch March 21, 2024 02:03
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.

None yet

3 participants