Page MenuHomePhabricator

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

Authored by ashoat on Apr 30 2024, 11:37 AM.
Tags
None
Referenced Files
F3303111: D11846.id39745.diff
Mon, Nov 18, 10:25 AM
F3302747: D11846.id39711.diff
Mon, Nov 18, 8:23 AM
Unknown Object (File)
Wed, Nov 13, 7:57 PM
Unknown Object (File)
Wed, Nov 13, 1:43 PM
Unknown Object (File)
Wed, Nov 13, 12:50 PM
Unknown Object (File)
Tue, Nov 12, 4:53 PM
Unknown Object (File)
Oct 10 2024, 8:19 PM
Unknown Object (File)
Oct 10 2024, 8:19 PM
Subscribers

Details

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

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

native/data/sqlite-data-handler.js
46 ↗(On Diff #39711)

I searched for other calls to clearSensitiveData. There was only one other one, which was for resetting the database in wipeAndExit. I don't think that's relevant here (we don't need to wait for that to happen, since we don't expect it to happen)

web/shared-worker/sqlite-data-handler.js
46 ↗(On Diff #39711)

I searched for other calls to sharedWorker.init with clearDatabase: true. There was only one other one, which was for resetting the database if some of our SQLite ops fail. I don't think that's relevant here (we don't need to wait for that to happen, since we don't expect it to happen)

This revision is now accepted and ready to land.May 1 2024, 10:21 AM