Page MenuHomePhabricator

[lib] Create a migration function
ClosedPublic

Authored by tomek on Mon, Mar 17, 7:13 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 17, 8:25 AM
Unknown Object (File)
Mon, Mar 17, 8:23 AM
Unknown Object (File)
Mon, Mar 17, 8:17 AM
Subscribers

Details

Summary

This function should be used during migrations. An example is described in the test plan.

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

Depends on D14457

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

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Mon, Mar 17, 7:52 AM
Harbormaster failed remote builds in B33734: Diff 47424!
Harbormaster returned this revision to the author for changes because remote builds failed.Tue, Mar 18, 4:09 AM
Harbormaster failed remote builds in B33760: Diff 47450!
tomek requested review of this revision.Tue, Mar 18, 4:21 AM
kamil requested changes to this revision.Tue, Mar 18, 9:16 AM
kamil added inline comments.
lib/shared/unshim-utils.js
70 ↗(On Diff #47450)

I don't see a reason for this to be optional. If I recall correctly, it was optionall in e.g. unshimClientDB because we wanted to handle both new migration and migrations before handleMigrationFailure was implemented.

107 ↗(On Diff #47450)

there is no cookie in the state, each keyserver from KeyserverStore should have its own cookie

This revision now requires changes to proceed.Tue, Mar 18, 9:16 AM

Make handleMigrationFailure mandatory

This revision is now accepted and ready to land.Wed, Mar 19, 8:35 AM
This revision was automatically updated to reflect the committed changes.