Irrelevant info but I wanted to get it out of my chest
I thought I broke it in my big refactor of the communications, specially because I redid the part of the RPC and subscriptions to provider communications: https://github.com/cowprotocol/cowswap/pull/3871
I was sure it was my PR, and I would swear it was working before my change, but I saw later that is also broken even in production. I spent debugging what of my changes broke it for quite a lot! š
EDIT: I think i know what is happening!
I think i know what is happening and why I thought that I had broken it
I thought it was not "disconnecting' but it was! but after disconnecting, it was automatically connected to the injected wallet, and because i had given permission to the the original web (in this case localhost:3000), it was showing me an account inside the app even though I disconnected
So the issue is, we should make sure we don't use the injected wallet in the widget if the host dapp is handling the connection.
Description When we disconnect the widget in https://widget.cow.fi , it breaks:
We emit correctly the events:
disconnect
andclose
(this last one is deprecated EIP-1193 event)However, something is not good in the handling: https://github.com/cowprotocol/cowswap/blob/release/2024.02.14/libs/wallet/src/web3-react/connectors/Injected/index.tsx#L156
Irrelevant info but I wanted to get it out of my chest
I thought I broke it in my big refactor of the communications, specially because I redid the part of the RPC and subscriptions to provider communications: https://github.com/cowprotocol/cowswap/pull/3871
I was sure it was my PR, and I would swear it was working before my change, but I saw later that is also broken even in production. I spent debugging what of my changes broke it for quite a lot! š
EDIT: I think i know what is happening!
I think i know what is happening and why I thought that I had broken it
I thought it was not "disconnecting' but it was! but after disconnecting, it was automatically connected to the injected wallet, and because i had given permission to the the original web (in this case localhost:3000), it was showing me an account inside the app even though I disconnected
So the issue is, we should make sure we don't use the injected wallet in the widget if the host dapp is handling the connection.