Page MenuHomePhabricator

[web] Move createAsyncMigrate to lib
ClosedPublic

Authored by michal on Jun 28 2023, 3:55 AM.
Tags
None
Referenced Files
F3491408: D8352.diff
Wed, Dec 18, 7:10 PM
Unknown Object (File)
Sun, Dec 15, 10:38 PM
Unknown Object (File)
Sun, Dec 15, 10:38 PM
Unknown Object (File)
Sun, Dec 15, 10:38 PM
Unknown Object (File)
Sun, Dec 15, 10:37 PM
Unknown Object (File)
Sun, Dec 15, 10:22 PM
Unknown Object (File)
Wed, Dec 11, 3:49 PM
Unknown Object (File)
Fri, Nov 22, 10:32 PM
Subscribers

Details

Summary

https://linear.app/comm/issue/ENG-3997/support-async-migrations-on-native
We want to support async migrations on native, as we do on the web. This diffs moves the createAsyncMigrate function to lib, and extracts web-specific code.

Test Plan

(tested on firefox)

  1. Remove firefox from DB_SUPPORTED_BROWSERS, change stateVersion on web from 2 to 1, clear all data for localhost in firefox
  2. Open the web app, check if indexedDB is empty, create a dummy draft
  3. Add firefox to supported browsers, bump stateVersion to 2
  4. Open the app, check if the draft is still there, check if indexedDB has data
  5. Refresh the app check if the draft is still there

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

kamil added a reviewer: ashoat.

This is changing dependency, so probably @ashoat approval is needed.

lib/shared/create-async-migrate.js
31–41 ↗(On Diff #28206)

maybe this is more readable?

web/redux/persist.js
95 ↗(On Diff #28206)

that's my bad while working on it, but maybe it's better to move root to
single constant

We already use this dependency

This revision is now accepted and ready to land.Jul 2 2023, 7:12 PM