Page MenuHomePhabricator

[native] Migrate to new id schema
ClosedPublic

Authored by michal on Jun 30 2023, 3:23 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 28, 8:38 AM
Unknown Object (File)
Sun, Oct 20, 11:54 AM
Unknown Object (File)
Oct 4 2024, 11:08 AM
Unknown Object (File)
Oct 2 2024, 12:50 AM
Unknown Object (File)
Oct 1 2024, 1:39 AM
Unknown Object (File)
Sep 28 2024, 3:33 PM
Unknown Object (File)
Sep 28 2024, 3:33 PM
Unknown Object (File)
Sep 28 2024, 3:33 PM
Subscribers

Details

Summary
Test Plan
  • Run the old version of the app, create some drafts, close the app
  • Run the new version of the app, check if drafts still exist
  • Explore the app, check if there are any problems
  • Compare redux and sqlite from before and after, and check if all ids were converted

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil requested changes to this revision.Jul 3 2023, 7:21 AM

I think there is a performance problem here, you call getClientDBStore() at least twice, which is a very heavy operation and executes in sequence things that can be wrapped in Promise.all. Can you refactor this to:

  • call getClientDBStore() only once and make the entire logic operate on this result
  • create promises and put them into Promise.all?
native/redux/persist.js
598–606 ↗(On Diff #28287)

can this be defined in a separate function with a descriptive name?

602 ↗(On Diff #28287)

I think it's better to use keyserverPrefixID instead of 256

611–620 ↗(On Diff #28287)

my comments from updateClientDBMessageStoreThreads also applies here

This revision now requires changes to proceed.Jul 3 2023, 7:21 AM

Get all stores at the same time and await all updates concurrently. Extract conversion functions.

Looks a lot better!

lib/utils/migration-utils.js
68 ↗(On Diff #28380)

I saw this expression multiple times, I would prefer to create a simple function, sth like attachKeyserverID() but up to you

native/redux/persist.js
642 ↗(On Diff #28380)

I think it is better to avoid magic numbers

This revision is now accepted and ready to land.Jul 4 2023, 8:12 AM
This revision is now accepted and ready to land.Jul 18 2023, 6:37 AM