Page MenuHomePhabricator

[native][web] Regenerate QR code if any failures occur during login
ClosedPublic

Authored by ashoat on May 20 2024, 4:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jun 23, 1:02 AM
Unknown Object (File)
Thu, Jun 20, 1:13 PM
Unknown Object (File)
Thu, Jun 20, 2:05 AM
Unknown Object (File)
Wed, Jun 19, 11:09 AM
Unknown Object (File)
Wed, Jun 19, 10:24 AM
Unknown Object (File)
Wed, Jun 19, 10:24 AM
Unknown Object (File)
Wed, Jun 19, 10:23 AM
Unknown Object (File)
Wed, Jun 19, 10:21 AM
Subscribers
None

Details

Summary

We want to regenerate the QR code because if a failure occurs during keyserver auth, it will result in the device keys changing.

My first thought was that we could have an effect regenerate the QR code, but I'm not sure how to subscribe to changes in the device ID.

Instead, I decided to handle it imperatively. This works because we wait until the database is reset before returning from useLogIn.

Depends on D12115

Test Plan
  1. I added a console log to see what the device ID is when the QR code is generated
  2. I hardcoded a throw new Error during identity auth and confirmed that the device ID doesn't change when the QR code is regenerated
  3. I hardcoded a throw new Error during authoritative keyserver auth and confirmed that the device ID DOES change

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

native/qr-code/qr-code-screen.react.js
71 ↗(On Diff #40390)

The only change was adding this line. I considered splitting this diff into two (a move diff and a diff that added this line) but figured this case was simple enough that it wasn't necessary

web/account/qr-code-login.react.js
92 ↗(On Diff #40390)

The only change was adding this line

This revision is now accepted and ready to land.May 20 2024, 7:26 AM