Page MenuHomePhabricator

[native] Set the DB version after registration
ClosedPublic

Authored by tomek on May 8 2024, 6:59 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 10, 12:35 PM
Unknown Object (File)
Sun, Nov 10, 7:26 AM
Unknown Object (File)
Sun, Nov 10, 6:26 AM
Unknown Object (File)
Sun, Nov 10, 4:34 AM
Unknown Object (File)
Sun, Nov 10, 2:08 AM
Unknown Object (File)
Thu, Nov 7, 12:53 PM
Unknown Object (File)
Sat, Oct 26, 6:55 PM
Unknown Object (File)
Oct 10 2024, 10:40 PM
Subscribers

Details

Summary

When a new account is created, we have to store the version in the DB so that it is included in a backup.
We don't need to set the version when a user logs in, because we can assume that eventually, we will restore the data from a backup - and that includes the version.

https://linear.app/comm/issue/ENG-7006/back-up-redux-version

Depends on D11937

Test Plan

Register a new user and check if the version is present in Redux and in the DB.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tomek requested review of this revision.May 8 2024, 7:16 AM
tomek planned changes to this revision.May 8 2024, 9:03 AM
tomek requested review of this revision.May 8 2024, 9:08 AM

I planned changes because I thought there was an issue with the current users - they are already registered, so we won't put the version into the DB for them and their backup won't contain it. Actually, there's no such problem, because in order to create a backup, the app should be run, and the migration from the previous diff will be performed and will put the version into the DB.

Can you test a scenario where the migration is run on a logged out screen, and then the user logs in? Can you verify that the db has the correct version set in this case?

Can you test both SIWE and password?

This revision is now accepted and ready to land.May 14 2024, 11:15 PM
In D11942#341891, @inka wrote:

Can you test a scenario where the migration is run on a logged out screen, and then the user logs in? Can you verify that the db has the correct version set in this case?

It shouldn't matter: we aren't restoring the backup as the part of a login yet. When we start doing it, it will contain the version. Also, registration sets the version. But I checked the version in the DB - and it is correct.

Can you test both SIWE and password?

Checked this - works for both types.