HomePhabricator
Diffusion Comm f666ef5176d1

[native] Migrate `messageStore.messages` persistence from `redux-persist` to…

Description

[native] Migrate messageStore.messages persistence from redux-persist to SQLite

Summary:
This is the diff that "flips the switch": https://linear.app/comm/issue/ENG-1189/flip-from-persisting-messagestore-in-redux-to-sqlite

Bascially we're enabling the "transform" that excludes messageStore.messages from being included in what's persisted by redux-persist... and we're "rehydrating" messageStore.messages in SQLiteContextProvider as we do with the threadStore.

We also bump the persistConfig.version to 31 to ensure that the messages that are currently in messageStore.messages get persisted in the SQLite store.

Test Plan:
I tried to test each "part" of this independently... and then also "went through" the migration a few times with my physical device and prod store to make sure that things worked as expected.

To test the "transform," I included the transform in the persistConfig and set breakpoints within the inbound tranformation function to ensure that the inputs and outputs were as expected.

To test the migration, I set breakpoints in the native C++ processMessageStoreOperationsSync(...) function and observed that the messages that were previously in messageStore.messages were persisted as expected.

Finally, I tested this change "as a whole" multiple times on the iOS Simulator and my physical iPhone.

  1. Load build 134 on the device by checking out the codeVersion bump commit (or via TestFlight on my physical device)
  2. Log into the app and ensure that everything loads and looks as expected
  3. Create a Release build with this change included
  4. See that the new version of the app installs without issue, I continue to be logged in, and that the redux migration completed as expected.
  5. Use the app for a bit and make sure that things continue to work as expected.6. Close the app, re-launch the app, etc a few times to ensure that things are working as expected.

Nonetheless, there are a lot of moving parts involved in this change so it is "on the riskier side" IMO... I'll make a staff release so we can all "test" the migration and see if anything comes up.

Reviewers: def-au1t, palys-swm, ashoat, marcinwasowicz

Reviewed By: palys-swm, marcinwasowicz

Subscribers: Adrian, yayabosh

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

Details

Provenance
atulAuthored on Jun 2 2022, 7:39 AM
Reviewer
tomek
Differential Revision
D4184: [native] Migrate `messageStore.messages` persistence from `redux-persist` to SQLite
Parents
rCOMMd83e9d0f162e: [android] Convert `splash_background` JPEGs to WEBP
Branches
Unknown
Tags
Unknown