[web] Restore compaction
Summary:
Restore compaction on web. Because web keeps redux persist storage in the database, and native doesn't, we must also:
- save redux persist date before restoration
- put it back after it's restored
We can do that before applying logs, before we can be sure that they won't touch this table.
Moved a few persist constants to a new file because otherwise webworker imported something that used window, which isn't available there.
Depends on D11042
Test Plan:
- Add logging to the native client so that it logs backupID and encryption keys for compaction
- Upload a new compaction from native with a draft
- Send restore message
- Reload web app
- Check that the draft from native exists now on web. Check that the enabled apps are the same as before restore (redux persist didn't change)
Reviewers: marcin, bartek, kamil
Reviewed By: kamil
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D11043