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

4.42.0 walletconnect action button causes ui to crash #2689

Open
vad99lord opened this issue Apr 25, 2024 · 9 comments
Open

4.42.0 walletconnect action button causes ui to crash #2689

vad99lord opened this issue Apr 25, 2024 · 9 comments

Comments

@vad99lord
Copy link

vad99lord commented Apr 25, 2024

I have the following problem with walletconnect feature on the latest app using macOS 12. When I open the network (eth) and select wallet connect ui becomes empty.

image

When enabling debugging with QTWEBENGINE_REMOTE_DEBUGGING=<port_number> I catch this error in the console when clicking on the connect button:

qrc:/assets/index-cNUc17VX.js:46 TypeError: Cannot read property 'split' of undefined
    at Sve (qrc:/assets/index-cNUc17VX.js:1407)
    at qrc:/assets/index-cNUc17VX.js:1428
    at Array.map (<anonymous>)
    at r1e (qrc:/assets/index-cNUc17VX.js:1428)
    at cf (qrc:/assets/index-cNUc17VX.js:44)
    at Dm (qrc:/assets/index-cNUc17VX.js:46)
    at hy (qrc:/assets/index-cNUc17VX.js:46)
    at uy (qrc:/assets/index-cNUc17VX.js:46)
    at sz (qrc:/assets/index-cNUc17VX.js:46)
    at Wu (qrc:/assets/index-cNUc17VX.js:46)
Cm @ qrc:/assets/index-cNUc17VX.js:46
Ux.n.callback @ qrc:/assets/index-cNUc17VX.js:46
j0 @ qrc:/assets/index-cNUc17VX.js:44
R0 @ qrc:/assets/index-cNUc17VX.js:46
oy @ qrc:/assets/index-cNUc17VX.js:46
iz @ qrc:/assets/index-cNUc17VX.js:46
cz @ qrc:/assets/index-cNUc17VX.js:46
Dr @ qrc:/assets/index-cNUc17VX.js:46
sy @ qrc:/assets/index-cNUc17VX.js:46
S @ qrc:/assets/index-cNUc17VX.js:31
N @ qrc:/assets/index-cNUc17VX.js:31

If I'm understanding correctly the error occurs in getAddressFromEIPString that receives invalid address. I couldn't build the project locally, so I wasn't able to investigate it further.

@vad99lord
Copy link
Author

vad99lord commented Apr 25, 2024

Clearing WALLET_CONNECT_INDEXED_DB has helped, seems like there was some info persisting about prior sessions that were somehow broken.

UPD: The error occurs for me when connecting to this website: https://highlight.xyz/. There is a connection error on the website itself, but the wallet ui crashes during the connection process.

@vad99lord
Copy link
Author

I've managed to build the app and log the wallet connection session. The problem is happening because the accounts array is empty in the session object:

{ "eip155": { "chains": [], "methods": [ "eth_sendTransaction", "eth_signTransaction", "eth_sign", "personal_sign", "eth_signTypedData", "eth_signTypedData_v4" ], "events": [ "accountsChanged", "chainChanged" ], "accounts": [] } }
and the wc receive address fails to retrieve the first account here.

@Tomasvrba
Copy link
Contributor

Tomasvrba commented Apr 25, 2024

I've managed to build the app and log the wallet connection session. The problem is happening because the accounts array is empty in the session object:

{ "eip155": { "chains": [], "methods": [ "eth_sendTransaction", "eth_signTransaction", "eth_sign", "personal_sign", "eth_signTypedData", "eth_signTypedData_v4" ], "events": [ "accountsChanged", "chainChanged" ], "accounts": [] } } and the wc receive address fails to retrieve the first account here.

Was just about to post this, that's exactly right.
Unfortunately https://highlight.xyz/ doesn't provide the account (eth address) it wants to interact with in the session's namespaces/requiredNamespaces

need to think about how to resolve this since there are multiple accounts/addresses you can have in the bitbox app and we rely on the namespaces to connect the correct one to the dapp

@Tomasvrba
Copy link
Contributor

@vad99lord if you've managed to build the app you can change
https://github.com/digitalbitbox/bitbox-wallet-app/blob/7f336345f03734d3e2e8081bc57a216a81e3ec7d/frontends/web/src/routes/account/walletconnect/dashboard.tsx#L112

to
receiveAddress={session.namespaces['eip155'].accounts[0] ? getAddressFromEIPString(session.namespaces['eip155'].accounts[0]) : ''}

everything will work fine until we release a fix, just the name and address of the account won't show up in the wallet connect overview in active sessions in the bitbox app

@vad99lord
Copy link
Author

@vad99lord if you've managed to build the app you can change

https://github.com/digitalbitbox/bitbox-wallet-app/blob/7f336345f03734d3e2e8081bc57a216a81e3ec7d/frontends/web/src/routes/account/walletconnect/dashboard.tsx#L112

to receiveAddress={session.namespaces['eip155'].accounts[0] ? getAddressFromEIPString(session.namespaces['eip155'].accounts[0]) : ''}

everything will work fine until we release a fix, just the name and address of the account won't show up in the wallet connect overview in active sessions in the bitbox app.

Thanks for looking into the problem. I'll fix it for my use case.

@thisconnect
Copy link
Collaborator

Unfortunately https://highlight.xyz/ doesn't provide the account (eth address) it wants to interact with in the session's namespaces/requiredNamespaces

Would it be worth to make a feature request to hightlight.xyz so they provide etc address in the future?

@benma
Copy link
Contributor

benma commented May 7, 2024

@Tomasvrba what's the status? Wen PR? 😄

@Tomasvrba
Copy link
Contributor

@Tomasvrba what's the status? Wen PR? 😄

Sorry it took a while to get around to this :)
#2712

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

No branches or pull requests

4 participants