Page MenuHomePhabricator

[web] Run backup migrations
AcceptedPublic

Authored by tomek on May 15 2024, 5:02 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jun 21, 12:11 PM
Unknown Object (File)
Wed, Jun 19, 9:49 AM
Unknown Object (File)
Tue, Jun 18, 8:45 AM
Unknown Object (File)
Mon, Jun 17, 10:30 PM
Unknown Object (File)
Mon, Jun 17, 10:30 PM
Unknown Object (File)
Mon, Jun 17, 10:29 PM
Unknown Object (File)
Sun, Jun 16, 9:11 PM
Unknown Object (File)
Sat, Jun 15, 12:06 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