1.8 KiB
Sign in flow
TODO: this document is outdated
tl;dr
In general, at first we try to encrypt realm database using password
and then proceed with the rest of operations. We do not wait for
Statusgo.Login
callback in order to show :home
screen with chats
as this call may add more than 1s to the process.
In details
Main flow:
-
User enters password
-
Presses "Sign In"
-
Attempt to open account's db
-
a. If DB file doesn't exist go to Empty DB flow
b. Otherwise continue
-
a. If db can't be encrypted go to Verify password flow
b. Otherwise continue
-
a. If db can't be migrate DB schema show migrations failure popup with option to erase DB
b. Otherwise continue
-
Proceed with UI flow and [Statusgo.Login flow] (#statusgologin-flow)
Empty DB flow:
-
Verify password
-
a. If password is wrong show "Wrong password" label
b. Otherwise continue
-
Create account's DB (by opening it with correct encryption key)
-
Proceed with UI flow and [Statusgo.Login flow] (#statusgologin-flow)
Verify password flow:
-
Verify password
-
a. If password is correct show encryption failure popup with option to erase DB
b. Otherwise show "Wrong password" label
Statusgo.Login flow:
-
Start node
-
"node.ready" event received
-
Statusgo.Login is called
-
Statusgo.Login callback
-
a. If password is incorrect show error popup (passwords used for db encryption and for account do not match)
b. Otherwise continue
-
Done
UI flow:
- Load necessary data for last 10 chats
- Show
:home
screen - Load the rest of chats
- Show them too
- Done