Page MenuHomePhabricator

[web] Run backup migrations
AcceptedPublic

Authored by tomek on May 15 2024, 5:02 AM.
Tags
None
Referenced Files
F2035264: D12048.id40888.diff
Tue, Jun 18, 8:45 AM
F2028058: D12048.id40288.diff
Mon, Jun 17, 10:30 PM
F2028057: D12048.id40208.diff
Mon, Jun 17, 10:30 PM
F2027991: D12048.id.diff
Mon, Jun 17, 10:29 PM
Unknown Object (File)
Sun, Jun 16, 9:11 PM
Unknown Object (File)
Sat, Jun 15, 12:06 PM
Unknown Object (File)
Fri, Jun 14, 9:05 AM
Unknown Object (File)
Fri, Jun 14, 12:06 AM
Subscribers

Details

Reviewers
kamil
marcin
varun
Summary

Run the Redux migrations using the default state and a restored SQLite. We run these only because they are modifying the SQLIte and we don't care about the Redux state that was transformed - we're using the default state and throw away the result.
In order to run the migrations on the worker, I had to move some things around.

https://linear.app/comm/issue/ENG-7009/run-redux-migrations-after-the-backup-is-restored

Depends on D12016

Test Plan

Create a backup on native, add a migration on web, open the web app, restore a migration and check in the logs if the migration was run. The migration is run, but then processing the ops fails due to https://linear.app/comm/issue/ENG-8102/its-not-possible-to-get-a-worker-from-a-worker.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

web/redux/default-state.js
44–45 ↗(On Diff #40208)

In the worker context window isn't present and we currently don't care about the exact values

74 ↗(On Diff #40208)

This also isn't set in the worker context

web/shared-worker/worker/backup.js
87–106 ↗(On Diff #40208)

This is the only interesting part of this diff

tomek requested review of this revision.May 15 2024, 5:19 AM
web/redux/default-state.js
44–45 ↗(On Diff #40208)

I don't have much context on the rest of the stack, but I'm wondering if you can explain the significance of this change a bit more. Are there states where the app will now have { width: 0, height: 0 } in its Redux state now? Or is this part of defaultState not actually used on the web worker?

web/redux/default-state.js
44–45 ↗(On Diff #40208)

The Redux state always has the correct value. This change only affects the default state which we use to perform the DB migration on the worker and then throw away.

This revision is now accepted and ready to land.May 17 2024, 3:14 AM