HomePhabricator
Diffusion Comm e27a6dfb78f0

[lib][native][web] Wait until database deletion before rejecting…

Description

[lib][native][web] Wait until database deletion before rejecting login/registration attempt

Summary:
In the prior diff, we introduce some logic for resetting login state when authoritative keyserver auth fails during login or registration.

However, we don't wait for the login state to be reset before letting the user retry. That can lead to TASK_CANCELLED errors when we attempt ops on SQLite while it is in the process of being cleared (initially described on Linear).

To avoid this, we won't let the user retry until the database deletion is complete. During this period the UI will continue to show the login or registration as being in progress.

Note – would normally put @tomek and @inka on this review, but since they're out for the rest of this week, I'm asking @varun to review.

Depends on D11845

Test Plan:

  1. Replicate the test plan in the parent diff (D11845)
  2. Repeatedly press the registration button while it's spinning, so that when it stops spinning it is immediately triggered
  3. Confirm that there is no TASK_CANCELLED error during identity auth, and no TASK_CANCELLED error is printed to the logs

Reviewers: varun

Reviewed By: varun

Subscribers: varun, inka, tomek

Differential Revision: https://phab.comm.dev/D11846