status-mobile/doc/sign_in/readme.md

1.8 KiB

Sign in flow

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.

img

In details

Main flow:

  1. User enters password

  2. Presses "Sign In"

  3. Attempt to open account's db

  4. a. If DB file doesn't exist go to Empty DB flow

    b. Otherwise continue

  5. a. If db can't be encrypted go to Verify password flow

    b. Otherwise continue

  6. a. If db can't be migrate DB schema show migrations failure popup with option to erase DB

    b. Otherwise continue

  7. Proceed with UI flow and [Statusgo.Login flow] (#statusgologin-flow)

Empty DB flow:

  1. Verify password

  2. a. If password is wrong show "Wrong password" label

    b. Otherwise continue

  3. Create account's DB (by opening it with correct encryption key)

  4. Proceed with UI flow and [Statusgo.Login flow] (#statusgologin-flow)

Verify password flow:

  1. Verify password

  2. a. If password is correct show encryption failure popup with option to erase DB

    b. Otherwise show "Wrong password" label

Statusgo.Login flow:

  1. Start node

  2. "node.ready" event received

  3. Statusgo.Login is called

  4. Statusgo.Login callback

  5. a. If password is incorrect show error popup (passwords used for db encryption and for account do not match)

    b. Otherwise continue

  6. Done

UI flow:

  1. Load necessary data for last 10 chats
  2. Show :home screen
  3. Load the rest of chats
  4. Show them too
  5. Done