status-im / status-desktop

Status Desktop client made in Nim & QML
https://status.app
Mozilla Public License 2.0
270 stars 75 forks source link

Change password flow attempts to relaunch the application but fails #15178

Open anastasiyaig opened 1 week ago

anastasiyaig commented 1 week ago

Bug Report

Description

When changing password, after i click Restart status button, the app is being closed, but when i open logs i am seeing an attempt to restart it , which is being killed as second instance

Steps to reproduce

  1. create new account
  2. proceed with changing password flow
  3. check logs

Actual behavior

App is failed to restart because of Terminating the app as the second instance topics

DBG 2024-06-14 09:31:31.055+03:00 NewBE_callPrivateRPC                       topics="rpc" tid=3530 file=core.nim:27 rpc_method=wakuext_getProfileShowcasePreferences
DBG 2024-06-14 09:31:31.075+03:00 NewBE_callPrivateRPC                       topics="rpc" tid=3505 file=core.nim:27 rpc_method=wakuext_shareUserURLWithData
DBG 2024-06-14 09:31:31.099+03:00 [threadpool task thread] initiating task   topics="task-threadpool" tid=3526 file=threadpool.nim:54 messageType=AsyncLoadDevicesTaskArg:ObjectType threadid=3526 task="{\"$type\":\"AsyncLoadDevicesTaskArg:ObjectType\",\"vptr\":94442629783136,\"slot\":\"asyncDevicesLoaded\",\"tptr\":94442485038224}"
DBG 2024-06-14 09:31:31.100+03:00 NewBE_callPrivateRPC                       topics="rpc" tid=3526 file=core.nim:27 rpc_method=wakuext_getOurInstallations
DBG 2024-06-14 09:31:54.771+03:00 NewBE_callPrivateRPC                       topics="rpc" tid=3505 file=core.nim:27 rpc_method=eth_accounts
DBG 2024-06-14 09:31:54.873+03:00 [threadpool task thread] initiating task   topics="task-threadpool" tid=3529 file=threadpool.nim:54 messageType=ChangeDatabasePasswordTaskArg:ObjectType threadid=3529 task="{\"$type\":\"ChangeDatabasePasswordTaskArg:ObjectType\",\"accountId\":\"0xa37c2cc4b5fa4990ce38fe674f313976dbeceb97e910dfe342f7d61999a8e58b\",\"currentPassword\":\"0x24c0d7a066ff54818763e54d728333d390230a3748b813fa082f3bb07d0d4ef5\",\"newPassword\":\"0xa4ea805dd7b7e22b1f4f1a3d645e048d8bd4f0d98d913253f3d50cf4ab3631ce\",\"vptr\":94442629782368,\"slot\":\"onChangeDatabasePasswordResponse\",\"tptr\":94442484729120}"
WRN 2024-06-14 09:31:58.165+03:00 Error decoding signal                      topics="signals-manager" tid=3505 file=signals_manager.nim:49 err="Unknown signal received: mediaserver.started"
WRN 2024-06-14 09:31:59.915+03:00 Error decoding signal                      topics="signals-manager" tid=3505 file=signals_manager.nim:49 err="Unknown signal received: mediaserver.started"
INF 2024-06-14 09:32:02.461+03:00 shutting down...                           topics="status-app" tid=3505 file=nim_status_client.nim:182
INF 2024-06-14 09:32:02.461+03:00 logging out...                             topics="app-controller" tid=3505 file=app_controller.nim:298
2024/06/14 09:32:02 websocket: failed to close network connection: close tcp 192.168.0.12:44794->47.76.168.186:443: use of closed network connection
INFO [06-14|09:32:02.552] Status backend initialized               backend=geth version=0.179.9 commit=fb63f0c1e IpfsGatewayURL=https://ipfs.status.im/
2024/06/14 09:32:02 websocket: failed to close network connection: close tcp 192.168.0.12:39386->34.170.154.2:443: use of closed network connection
INF 2024-06-14 09:32:02.692+03:00 Terminating the app as the second instance topics="status-app" tid=3615 file=nim_status_client.nim:197
2024/06/14 09:32:02 websocket: failed to close network connection: close tcp 192.168.0.12:40358->8.218.23.76:443: use of closed network connection

Expected behavior

It is not clear if we can really implement app restart (show login window after changing password), but current behavior is a reason of my autotests being failed randomly, because:

On the video below. I am running test and i have my status app installed in Application folder (it is my main app instance that should be intact). It is clearly visible that the test launches 2 applications

https://github.com/status-im/status-desktop/assets/82375995/57a1e53e-d8ac-48f9-935f-8f43968cd227

Additional Information

igor-sirotin commented 1 week ago

Actually, it should be possible to log out without restarting the app. And that should fix the issue in all cases. We have Logout status-go method, and I even think that mobile supports it.

I remember there was some issue why we couldn't use it. But I'm pretty sure there's nothing unsolvable.