-
Notifications
You must be signed in to change notification settings - Fork 92
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 walletconnect double qr code updated #444
Fix walletconnect double qr code updated #444
Conversation
CLA Assistant Lite All Contributors have signed the CLA. |
|
Hey @alfetopito , this PR, unfortunately, does not solve #342 issue. As for the #352 bug, it is partially solved (case 1), but case 2 is still here: |
@elena-zh the issue from the video seems to be related to the tx hash not being updated, correct? Does it work ok if you don't cancel/speed up txs? As for #342 , didn't expect it to fix it. Will take a look at that in the other issue. Lastly, does this PR addresses the issue mentioned with the double QR codes when trying to connect with WalletConnect? |
@alfetopito , the video is about connection issues with Gnosis Safe transactions: 'View details' show a not existing TxHash, however, should navigate to the transactions list in Gnosis safe (described in #342 ), and it is not related to that what Ramiro was trying to fix.
Yes, as I have mentioned above, this issues fixes the 1st part of the #351 issue (double QR code). |
@elena-zh now I see what you meant. I've managed to get it working. Could you please try it out again with the Safe and other WalletConnect based wallets? |
Hey @alfetopito , great changes! However, with the code in #360 PR the next issue was transferred to the current PR: gnosis/cowswap#2547 (comment) The issue was reported about 1Inch wallet, but it is also reproducible for MM mobile wallet, so, from my perspective, it might be important to take a look and fix it. So when I try to run wrap/unwrap/approve transactions in MM/1Inch wallets (using WC) in iOS, I get an additional pop-up to open the app, and then I'm navigated to the app store instead of being navigated to the wallet to sign the transaction Could you please take a look into this issue? Thanks! |
The issue is not reproducible in Uniswap: https://drive.google.com/file/d/1xnmRWEFy9Ce8dYbkM8wowXyYlSCyr8Qn/view?usp=sharing |
In Android it works through an intermediate step for selecting a wallet to sigh a transaction: SVID_20220426_164509_1.mp4 |
@@ -60,7 +60,8 @@ function checkIsSupportedWallet(params: { | |||
async function getWcPeerMetadata(connector: WalletConnectConnector): Promise<{ walletName?: string; icon?: string }> { | |||
const provider = (await connector.getProvider()) as WalletConnectProvider | |||
|
|||
const meta = provider.walletMeta | |||
// fix for this https://github.com/gnosis/cowswap/issues/1929 | |||
const meta = provider.walletMeta || provider.signer.connection.wc.peerMeta |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cant this just be provider.peerMeta? why the long chain in signer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also from Nenad's original PR.
Anyway, I'll update with your suggestion
.then(() => { | ||
// Manually set the WalletConnectConnector http.connection.url to currently connected network url | ||
// Fix for this https://github.com/gnosis/cowswap/issues/1930 | ||
if (connector instanceof WalletConnectConnector) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this also be connector.isWalletConnect
?
@@ -88,7 +88,7 @@ export function useEagerConnect() { | |||
if (!active) { | |||
const latestProvider = localStorage.getItem(STORAGE_KEY_LAST_PROVIDER) | |||
|
|||
// if there is no last saved provider set tried state to true | |||
// If there is no last saved provider set tried state to true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wut
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not my changes.
For context: When reviewing Nenad's original PR, there were comments about the case of the comments.
Keep in mind these were all coming from Uniswap.
Anyway, @nenadV91 was very kind and did abide by the requests.
window.addEventListener('beforeunload', handleBeforeUnload) | ||
|
||
// remove beforeunload event listener on component unmount | ||
// Remove beforeunload event listener on component unmount |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this some new grammarnazi lint rule or is this custom? seems very unnecessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approve with comments
i have this PR open locally and running yarn install has added:
to my yarn lock file - the previous error @nenadV91 and @anxolin and I saw was referring to missing browser stuff. could be related |
25d6909
to
5755129
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR works for me in 1inch and IOS. Kind of, because it works only using ETHSIGN instead of EIP-712.
However, I don't see the reason why is the case.
As we see here, it tries v4, then v3 then ethsign:
I watched in the WS how the message that says that the method is not supported comes from the wallet. So I would think its 1inch not implementing some of this signing methods.
It's likely that their names changed a bit (EIP-712 rpc calls were changing names since it was in draft mode for a while). Maybe 1inch can review why the other wallets work, but not them?
I see that we changed the version of "ethers" (and the old one is no longer compatible without moding many parts of the project)
See the details of the relevant library versions here.
https://docs.google.com/document/d/1EXF-gE3ViJ_Yto-14Sy-BrLNZAT0K34EtyMihEWQi8k/edit#
I'm approving this PR so we don't delay more the version. After all, I was able to trade using 1inch IOS wallet, and probably the issue can be solved in the wallet side.
Some relevant conversations: https://cowservices.slack.com/archives/C0375NV72SC/p1651608634798579 and https://cowservices.slack.com/archives/C0361CDG8GP/p1651606102100549
- Force clearing another field. We might eventually need to do this with all fields - Removing some wait times
I still see a request to open App store when I send a request to Approve a token using MM However, I proceeded and opened the AppStore, then opened MM from there, and was able to sign the approve transactions. Afterwards I was redirected back to the app store. Placing/cancelling orders work fine The same is for the 1Inch wallet. However, the CowSwap app page is changed to that one https://wallet.1inch.io/wc/, and transaction does not appear in the activity modal when go back to the Cowswap app. |
Summary
Same as #360 but updated to latest code on
develop
Closes #351
Closes #342