Page MenuHomePhabricator

[native] Fall back to v1 login when the user doesn't have a backup
ClosedPublic

Authored by tomek on Dec 20 2024, 9:04 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 3, 3:40 AM
Unknown Object (File)
Wed, Apr 2, 9:04 PM
Unknown Object (File)
Wed, Apr 2, 11:42 AM
Unknown Object (File)
Tue, Apr 1, 8:01 AM
Unknown Object (File)
Thu, Mar 27, 4:27 AM
Unknown Object (File)
Mar 17 2025, 6:33 AM
Unknown Object (File)
Mar 15 2025, 3:54 PM
Unknown Object (File)
Mar 15 2025, 3:54 PM
Subscribers

Details

Summary

Check if the user has a backup. When they don't have it, use the v1 login flow.

https://linear.app/comm/issue/ENG-9620/client-restore-flow-fall-back-to-v1-when-missing-backup

Depends on D14165

Test Plan

Because pf https://linear.app/comm/issue/ENG-10039/allow-checking-if-a-user-has-a-backup I had to hack it a bit: instead of calling retrieveLatestBackupInfo I hardcoded its return value to null. Then for both password and SIWE user verified that it is possible to log in.

Diff Detail

Repository
rCOMM Comm
Branch
restore4
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

tomek requested review of this revision.Dec 20 2024, 9:22 AM
native/account/restore-password-account-screen.react.js
52

At some point we'll probably want to rename usePasswordLogIn (and associated hooks) to reflect that they are v1 / legacy

kamil added 1 blocking reviewer(s): bartek.
kamil added inline comments.
native/account/restore-prompt-screen.react.js
57

After skipping the regeneration of the social proof duringthe restore is done, this will have to change but for now looks good

Because pf https://linear.app/comm/issue/ENG-10039/allow-checking-if-a-user-has-a-backup I had to hack it a bit: instead of calling retrieveLatestBackupInfo I hardcoded its return value to null. Then for both password and SIWE user verified that it is possible to log in.

I'm going to put up a diff which makes it behave as described in my inline comment

native/account/restore-password-account-screen.react.js
62–70

Assuming retrieveLatestBackupInfo returns null only if user exists, but doesn't have backup, this code is okay.
If user with given username cannot be found by Backup Service, it should throw user_not_found which is caught below

This revision is now accepted and ready to land.Jan 7 2025, 7:20 AM
native/account/restore-password-account-screen.react.js
52