Page MenuHomePhabricator

[native] Update device list on QR code scaned
ClosedPublic

Authored by bartek on Mar 11 2024, 6:17 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 7, 8:05 PM
Unknown Object (File)
Thu, Apr 25, 7:23 AM
Unknown Object (File)
Fri, Apr 19, 4:23 PM
Unknown Object (File)
Apr 1 2024, 3:53 PM
Unknown Object (File)
Mar 30 2024, 7:52 AM
Unknown Object (File)
Mar 27 2024, 11:25 PM
Unknown Object (File)
Mar 27 2024, 7:51 AM
Unknown Object (File)
Mar 23 2024, 8:44 PM
Subscribers

Details

Summary

Part of QR code auth flow - primary device performs device list update after the QR code is scanned. Then it notifies the secondary device that it can continue.

Depends on D11293

Test Plan

Ran the app on both simulator and physical phone - scanned QR code and made sure that Identity Service receives updated device list (checked the DDB table)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bartek held this revision as a draft.
bartek edited the test plan for this revision. (Show Details)
bartek published this revision for review.Mar 12 2024, 2:19 AM
native/profile/secondary-device-qr-code-scanner.react.js
56 ↗(On Diff #38013)

Should we add an invariant above this line that deviceLists.length > 0? Otherwise the error may not be very informative

70 ↗(On Diff #38013)

It doesn't affect like the return value is used in this diff. Is it really necessary?

kamil added inline comments.
native/profile/secondary-device-qr-code-scanner.react.js
40 ↗(On Diff #38013)

I think I saw this invariant in our codebase right after React.useContext but I might be wrong

62–73 ↗(On Diff #38013)
111 ↗(On Diff #38013)

I think this make is easier to understand

113 ↗(On Diff #38013)

Why not make onConnect async function?

This revision is now accepted and ready to land.Mar 13 2024, 5:36 AM
native/profile/secondary-device-qr-code-scanner.react.js
40 ↗(On Diff #38013)

Yeah it can be moved - we'll see the error sooner if it ever happens

56 ↗(On Diff #38013)

Good call

70 ↗(On Diff #38013)

It was mostly needed for debugging, to see if the device list was actually updated or not. I can get rid of the return value for now