Page MenuHomePhabricator

[web] Run backup migrations
Changes PlannedPublic

Authored by tomek on May 15 2024, 5:02 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 3, 10:36 AM
Unknown Object (File)
Sat, Oct 26, 10:09 PM
Unknown Object (File)
Oct 17 2024, 8:10 AM
Unknown Object (File)
Oct 15 2024, 1:20 AM
Unknown Object (File)
Oct 14 2024, 2:09 PM
Unknown Object (File)
Oct 14 2024, 7:44 AM
Unknown Object (File)
Oct 12 2024, 6:04 PM
Unknown Object (File)
Oct 12 2024, 6:04 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