Page MenuHomePhabricator

[native] Schedule backup generation and upload after saving SIWE secrets
ClosedPublic

Authored by tomek on Feb 28 2025, 5:57 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 2, 9:13 PM
Unknown Object (File)
Wed, Apr 2, 5:27 AM
Unknown Object (File)
Tue, Apr 1, 11:32 PM
Unknown Object (File)
Tue, Apr 1, 9:38 PM
Unknown Object (File)
Tue, Apr 1, 9:31 PM
Unknown Object (File)
Tue, Apr 1, 2:03 PM
Unknown Object (File)
Tue, Apr 1, 9:50 AM
Unknown Object (File)
Mon, Mar 31, 9:39 AM
Subscribers

Details

Summary

When a SIWE user logs in using a v1 fallback, they don't have SIWE secrets saved in the DB. They are set after an interaction with a modal, but that doesn't trigger backup generation and upload. These operations were performed only after the app was restarted - when the app starts, we would read the data saved in the previous session.

This diff solves this issue by exposing a function that can be used to trigger backup generation and upload and using this function after user provides the missing data.

https://linear.app/comm/issue/ENG-10271/generating-backups-for-siwe-users-who-used-v1-fallback-doesnt-work

Depends on D14417

Test Plan

Log in using v1 fallback. Sign a backup and check on AWS if the backup appears. Wipe state and kill the app and then restore - verify that the v2 is used by noticing that backup decrypt step is performed.

Diff Detail

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

Event Timeline

tomek requested review of this revision.Feb 28 2025, 6:16 AM
kamil added inline comments.
native/root.react.js
319 ↗(On Diff #47309)

Previously, the handler was gated - it isn't anymore but should be safe because we use usePersistedStateLoaded inside BackupHandlerContextProvider

This revision is now accepted and ready to land.Feb 28 2025, 7:58 AM