4.42.0 walletconnect action button causes ui to crash
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.
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.
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.
Thanks for the report.
@Tomasvrba @shonsirsha grepping split in WC-related files, maybe the issue is here?
https://github.com/digitalbitbox/bitbox-wallet-app/blob/7f336345f03734d3e2e8081bc57a216a81e3ec7d/frontends/web/src/components/wallet-connect/incoming-signing-request-dialog.tsx#L76
Can signingData be undefined? It seems it can at least be empty:
https://github.com/digitalbitbox/bitbox-wallet-app/blob/7f336345f03734d3e2e8081bc57a216a81e3ec7d/frontends/web/src/components/wallet-connect/incoming-signing-request-dialog.tsx#L116
The type says it cannot be undefined, but maybe that's a mistake?
https://github.com/digitalbitbox/bitbox-wallet-app/blob/7f336345f03734d3e2e8081bc57a216a81e3ec7d/frontends/web/src/utils/walletconnect-eth-sign-handlers.ts#L27
If so the split() function must not be called.
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.
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
@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 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.
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?
@Tomasvrba what's the status? Wen PR? :smile:
@Tomasvrba what's the status? Wen PR? 😄
Sorry it took a while to get around to this :) https://github.com/digitalbitbox/bitbox-wallet-app/pull/2712
Fixed both issues but highlight.xyz is still having issues signing in via their privy.io authentication provider, would recommend using the BitBox with Rabby instead for this, see: https://github.com/BitBoxSwiss/bitbox-wallet-app/pull/2712#issuecomment-2122239806
I contacted privy.io about the 422 Unprocessable content issues since I haven't been able to figure out what the reason is
@vad99lord just to inform you, the issue with Privy auth has gone away and as far as I can tell everything now works as it should