HomePhabricator
Diffusion Comm 13caf3c82264

[native] Redux migration to support minimally encoded permissions

Description

[native] Redux migration to support minimally encoded permissions

Summary:
Redux migration that pulls out existing RawThreadInfos from SQLite DB, "migrates" them to MinimallyEncodedRawThreadInfos (if they aren't already, but we're assuming they aren't), and then translates them back to ClientDBThreadInfo which gets persisted back into SQLite.

I'm fairly sure the logic in this migration is correct, but I still need to do additional testing. In initial testing I found some incorrect logic in convertClientDBThreadInfoToRawThreadInfo that was a little tricky because flow trusts that anything you JSON.parse(...) is the type you assign it to, which isn't always the case... Like with keyserverDB, we need to be careful about what external "raw string data" we're bringing "into the application." I will fix the logic errors, write some tests, and add some runtime validators to make sure the interface between "raw string data" stored in SQLite DB and our application is robust. I'll also just do another pass of the ClientDBThreadInfo <=> RawThreadInfo code to make sure everything is correct.


Depends on D10296

Test Plan:
Will run through migration and ensure that before/after is as expected. I found the issue mentioned in the description during this testing:

Screenshot 2023-12-11 at 6.46.32 PM.png (1×2 px, 946 KB)

Will make sure this migration is fully working before unmarking as DRAFT and definitely before landing.

Reviewers: ashoat, ginsu, tomek, rohan

Reviewed By: ashoat

Differential Revision: https://phab.comm.dev/D10297

Details

Provenance
atulAuthored on Dec 14 2023, 12:58 PM
Reviewer
ashoat
Differential Revision
D10297: [native] Redux migration to support minimally encoded permissions
Parents
rCOMMb780797c5e95: [keyserver] Move `threadStoreValidator` to `redux-state-responders`
Branches
Unknown
Tags
Unknown