Page MenuHomePhabricator

[lib][web][native] Redux store to persist latest backup info
ClosedPublic

Authored by kamil on Tue, Nov 26, 7:17 AM.
Tags
None
Referenced Files
F3523666: D14049.id46197.diff
Mon, Dec 23, 10:01 AM
F3521977: D14049.id46176.diff
Mon, Dec 23, 5:25 AM
F3519379: D14049.id46197.diff
Sun, Dec 22, 9:58 PM
F3517351: D14049.id46083.diff
Sun, Dec 22, 5:09 PM
Unknown Object (File)
Mon, Dec 16, 4:28 PM
Unknown Object (File)
Sun, Dec 15, 2:37 PM
Unknown Object (File)
Sat, Dec 14, 11:18 PM
Unknown Object (File)
Sat, Dec 14, 10:24 PM
Subscribers

Details

Summary

ENG-9700.

Native-specific store where we can put backup-related data.

I am not sure if it is better to put this in lib, even if this won't be used on the web at all and has cleaner code (e.g., reducing in master reducer, not in native specific), or leave it as it is.

Test Plan

Check if migrations works

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Tue, Nov 26, 7:53 AM
kamil edited the summary of this revision. (Show Details)
lib/types/backup-types.js
59 ↗(On Diff #46083)

Do we really need the migration? Won't it get merged with defaultState anyways?

lib/types/backup-types.js
53 ↗(On Diff #46083)

Typo

Do we really need the migration? Won't it get merged with defaultState anyways?

In the past, we had some bugs caused by relying on the default state instead of the migration. They can happen in the following scenario:

  1. A new store is added without a migration
  2. A new migration is added that uses this store
  3. A user updates the app from before the 1st step

Then migration 2 fails.

This revision is now accepted and ready to land.Wed, Nov 27, 7:12 AM

Do we really need the migration? Won't it get merged with defaultState anyways?

In the past, we had some bugs caused by relying on the default state instead of the migration. They can happen in the following scenario:

  1. A new store is added without a migration
  2. A new migration is added that uses this store
  3. A user updates the app from before the 1st step

Then migration 2 fails.

In this case, the store can be null, so it's hard to imagine such a scenario occurring... the code in the later migration would have to crash specifically on undefined but not on null.

  • fix typo
  • remove migration
  • make prop read-only