anyproto / anytype-ts

Official Anytype client for MacOS, Linux, and Windows
https://anytype.io
Other
4.01k stars 243 forks source link

fix double accountSelect on start #637

Closed requilence closed 5 months ago

requilence commented 5 months ago

For the full-client the account cycle should be one of these

  1. WalletRecover (deprecated, to be removed later)
  2. WalletCreateSession
  3. AccountSelect

or

  1. WalletCreate
  2. WalletCreateSession
  3. AccountCreate.

Currently it was a bug that accountSelect was called twice, like this

  1. WalletRecover
  2. AccountSelect
  3. WalletCreateSession
  4. AccountSelect

This resulted in the second AccountSelect being hanging and waiting for the lock of the first accountSelect. After first accountSelect finishes, the second returns success without ding any work under the hood. But in case of problems, e.g. when AccountSelect was unsuccessful, the second accountSelect actually was starting it over again. Also, in the last changes in mw we introduced account-start cancelation https://github.com/anyproto/anytype-heart/pull/1050. So this error becomes even more critical