trezor / trezor-suite

Trezor Suite Monorepo
https://trezor.io/trezor-suite
Other
723 stars 251 forks source link

Can't close Trezor Suite with Tor On and Solana account active #12628

Open evgenysl opened 5 months ago

evgenysl commented 5 months ago

Describe the bug If Solana account is activated and Tor is on, I can't close Trezor Suite.

Happens both on 24.5.2.and 24.5.3. and only on Arm Mac Not reproducible on Linux and Windows yet.

Steps to reproduce:

  1. Activate Solana account
  2. Turn on Tor
  3. Close the app
  4. Observe app is not closing and in Activity Monitor it's not responding

Info:

Expected result: App closes

Screenshots: Screenshot 2024-05-29 at 08 43 41

Note(s): related to https://github.com/trezor/trezor-suite/issues/12626 ?

bosomt commented 5 months ago

Managed to reproduce it on my machine by quiting app during discovery with tor on

image

Info:

MiroslavProchazka commented 3 months ago

@trezor/qa this still happening?

bosomt commented 3 months ago

QA NOK

still happening :(

Info:

enjojoy commented 2 weeks ago

I tried multiple times with solana activated and tor on but it never got to the Not Responding state. Can you please try replicating it again? @evgenysl @bosomt

evgenysl commented 2 weeks ago

Suite 24.10.1

Mouse pointer is actually MacOS loading spinner the whole time (not captured on video).

https://github.com/user-attachments/assets/fb744e05-f01f-48e1-bfe7-82c27add42ef

enjojoy commented 2 weeks ago

Suite 24.10.1

  • Empty wallet - no issues
  • Funded wallet - Suite takes longer time (about 50sec) to close and app is in Not Responding state

Mouse pointer is actually MacOS loading spinner the whole time (not captured on video).

Screen.Recording.2024-10-31.at.13.02.28.mov

Not sure what to do because I can't get this behavior on my M3

enjojoy commented 1 week ago
image image
enjojoy commented 1 week ago

Related issue

https://github.com/solana-labs/solana-web3.js/issues/2288

https://solana.stackexchange.com/questions/15171/how-to-handle-connection-failures-with-onlogs

marekrjpolak commented 1 week ago

@enjojoy the problem is in this part of @solana/web3.js and this line of Suite:

When Tor process is killed (in a pretty uninteresting manner I'd say) and Suite tries to unsubscribe Solana accs, the library function isCurrentConnectionStillActive() incorrectly returns true so the unsubscription is repeated in a neverending loop.

Preferred solution would be to fix the library (e.g. implement this todo or get the connection status from underlying socket's readyState). From our side, the only solution I see is not to unsubscribe the accounts on disconnect. :man_shrugging: