Page MenuHomePhabricator

[web/native] Migrate keyserverStore to new tables
ClosedPublic

Authored by michal on Mar 29 2024, 1:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 17, 6:47 AM
Unknown Object (File)
Sun, Nov 3, 8:03 AM
Unknown Object (File)
Oct 12 2024, 8:33 PM
Unknown Object (File)
Oct 12 2024, 8:33 PM
Unknown Object (File)
Oct 12 2024, 8:32 PM
Unknown Object (File)
Sep 30 2024, 1:59 AM
Unknown Object (File)
Sep 18 2024, 3:51 PM
Unknown Object (File)
Sep 18 2024, 12:16 AM
Subscribers

Details

Summary

Migrates the current data in one keyserver table to two. It works a bit unusually but the general gist is:

  • Copy the data from keyservers to keyserver_synced_data
  • Fetch the data in the migrations (db ops will merge the data from keyserver and keyserver_synced_data and so return the correct KeyserverInfo)
  • Save the data in the migration (db ops will now split the data correctly into two tables)

Also adds the non-synced keyservers table to backup blocklist.

Depends on https://phab.comm.dev/D11481

Test Plan

Make sure the migration runs correctly on both web and native. Compare the results from before the migration and after -> the keyserver infos should be the same (but urlPrefix is in a different table).

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

This revision is now accepted and ready to land.Apr 2 2024, 3:42 AM
kamil added inline comments.
native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
602–604

make indentation consistent with the rest of the file

612

I bit confusing in this diff you modifying existing migration - make sure to test it properly

native/redux/persist.js
1170–1190

we could reduce code duplication and move this to function but here we can at least make sure that no one will modify this code in the future - with function in a different place is less maintainable

Improve indentation

native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
612

These diffs will be landed together, it's just that the data migration required changes on JS side, which required changes to db schema. So to make the review easier and not put everything in one diff I decided to split it like this.

native/redux/persist.js
1170–1190

We are only repeating the code once, it's very simple, we don't expect that it will be modified in the future (as it's a migration) and it probably won't be reused in the future (as it's a no-op in other context) so I think it's fine to reuse code here.