Page MenuHomePhabricator

[web] Run backup migrations
Changes PlannedPublic

Authored by tomek on May 15 2024, 5:02 AM.
Tags
None
Referenced Files
F3513673: D12048.diff
Sun, Dec 22, 1:25 AM
F3512997: D12048.id40936.diff
Sat, Dec 21, 9:31 PM
F3512996: D12048.id40888.diff
Sat, Dec 21, 9:31 PM
F3512995: D12048.id40379.diff
Sat, Dec 21, 9:31 PM
F3512994: D12048.id40288.diff
Sat, Dec 21, 9:31 PM
F3512993: D12048.id40208.diff
Sat, Dec 21, 9:31 PM
F3512985: D12048.id.diff
Sat, Dec 21, 9:31 PM
F3512983: D12048.diff
Sat, Dec 21, 9:30 PM
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
tomek planned changes to this revision.Oct 2 2024, 3:19 AM