Page MenuHomePhabricator

[web] Run backup migrations
Changes PlannedPublic

Authored by tomek on May 15 2024, 5:02 AM.
Tags
None
Referenced Files
F3514769: D12048.id40208.diff
Sun, Dec 22, 6:29 AM
F3514752: D12048.id40288.diff
Sun, Dec 22, 6:25 AM
F3514704: D12048.id40888.diff
Sun, Dec 22, 6:15 AM
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
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

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

74

This also isn't set in the worker context

web/shared-worker/worker/backup.js
87–106

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

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

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