Page MenuHomePhabricator

[native] Add utils for migrating message store
ClosedPublic

Authored by michal on Jun 30 2023, 3:15 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jun 26, 11:25 PM
Unknown Object (File)
Wed, Jun 26, 10:19 AM
Unknown Object (File)
Tue, Jun 25, 2:15 PM
Unknown Object (File)
Mon, Jun 24, 4:04 PM
Unknown Object (File)
Mon, Jun 24, 4:04 PM
Unknown Object (File)
Mon, Jun 24, 4:04 PM
Unknown Object (File)
Mon, Jun 24, 4:03 PM
Unknown Object (File)
Mon, Jun 24, 3:54 PM
Subscribers

Details

Summary

https://linear.app/comm/issue/ENG-3995/create-functions-for-migrating-the-client-stores
Based on updateClientDBThreadStoreThreadInfos and previous migrations, I've added updateClientDBMessageStoreMessages and updateClientDBMessageStoreThreads.

Depends on D8355

Test Plan

Tested using the id schema migration introduced in the next diff in stack. Checked if the migration run correctly

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:50 AM

Similar feedback to D8385.

I think you should update functions to as input takes data from the database (fetched only once), return only operations, and later process those at once.

Also, I do not feel comfortable about mixing process*StoreOperationsSync and process*StoreOperations in one migration so probably you can stick to only one option and after generating all operations for migrating data do something similar to processDBStoreOperations.

native/redux/client-db-utils.js
13–21 ↗(On Diff #28286)

Can be merged

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

Update the migration functions so instead of fetching the stores, they take them as an argument and return operations.

This revision is now accepted and ready to land.Jul 4 2023, 7:51 AM