HomePhabricator
Diffusion Comm fe3542bad7fc

[lib] Create unshimming queue

Description

[lib] Create unshimming queue

Summary:
The unshimming process happens during a migration when it isn't convenient to call e.g. processDMOperations. To make this easier, we're saving the operations in Redux. We're processing them using a queue so that we don't have issues with e.g. Redux changes being skipped. We're removing the operations from SQLite only after they are processed.

https://linear.app/comm/issue/ENG-10329/create-a-new-action-and-modify-the-reducedmoperationsqueue-reducer

Depends on D14456

Test Plan:
Tested the whole stack on both native and web:

  1. Run the app on Redux version 86 with a modification to processDMOperation making all the INBOUND messages unsupported
  2. On one platform created a thread and sent a text message. These were visible on the sender, and invisible on the recipient
  3. Closed the recipient and added a migration that unshimms the thread creation operations, e.g.
unshimDMOperations(
  state,
  dmOperationTypes.CREATE_THREAD,
  handleReduxMigrationFailure,
): MigrationFunction<WebNavInfo, AppState>),
  1. Run the recipient and noticed the thread appearing
  2. Added another migration, this time unshimming text messages
  3. Run the recipient and noticed messages appearing

Reviewers: kamil, bartek

Reviewed By: kamil

Subscribers: ashoat

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

Details

Provenance
tomekAuthored on Fri, Mar 14, 10:52 AM
Reviewer
kamil
Differential Revision
D14457: [lib] Create unshimming queue
Parents
rCOMMddc042ca13e8: [native][web] Include fetching DM operations in SQLite API
Branches
Loading...
Tags
Loading...