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)
Sat, Nov 2, 1:47 AM
Unknown Object (File)
Fri, Nov 1, 1:57 PM
Unknown Object (File)
Fri, Nov 1, 1:57 PM
Unknown Object (File)
Fri, Nov 1, 1:57 PM
Unknown Object (File)
Fri, Nov 1, 1:57 PM
Unknown Object (File)
Oct 4 2024, 12:59 AM
Unknown Object (File)
Sep 8 2024, 2:00 AM
Unknown Object (File)
Sep 8 2024, 2:00 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