Page MenuHomePhabricator

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

Authored by kamil on Tue, Nov 26, 7:17 AM.
Tags
None
Referenced Files
F3389793: D14049.diff
Fri, Nov 29, 8:36 PM
Unknown Object (File)
Wed, Nov 27, 3:21 PM
Unknown Object (File)
Wed, Nov 27, 3:21 PM
Unknown Object (File)
Wed, Nov 27, 3:21 PM
Unknown Object (File)
Wed, Nov 27, 3:21 PM
Unknown Object (File)
Wed, Nov 27, 3:21 PM
Unknown Object (File)
Wed, Nov 27, 3:21 PM
Unknown Object (File)
Wed, Nov 27, 3:21 PM
Subscribers

Details

Reviewers
bartek
tomek
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
Branch
backup
Lint
No Lint Coverage
Unit
No Test Coverage

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

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

lib/types/backup-types.js
53

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.