This differential introduces store loaded to redux and makes sure it is not persisted. There are components that check storeLoaded flag to ensure data from SQLite was inserted to redux. Setting this flag in react state after redux actions are dispatched introduces some sort of race condition. Therefore we should keep this flag in redux and set it in reducer in response to the same action that inserts SQLite data.
Details
- Reviewers
tomek ashoat - Commits
- rCOMMb92b5e5e79cb: Move Store Loaded to redux
Make sure eslint and flow do not complain. add code in reducer in native that sets this flag to true. Add logging to make sure this flag is false after re-starting application.
Diff Detail
- Repository
- rCOMM Comm
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
Why this diff doesn't have reviewers set?
Are we planning to do something similar on web?
What is the purpose of this flag? (I guess the following diffs will answer that question, but it would be better for the summary to do so)
The test plan should also describe what was done to verify that the flag is not persisted.
I have always been under impression that, arcanist will not allow diff to be submitted if reviewers are not set. So I didn't realize I forgot to add reviewers after diff was submitted.
Are we planning to do something similar on web?
What is the purpose of this flag? (I guess the following diffs will answer that question, but it would be better for the summary to do so)
Currently we keep storeLoaded flag in react state and set it after actions that insert SQLite data to redux are dispatched. This is not correct since there are components that rely on this flag to check if SQLite data are present in redux, and reducing action might happen after this flag is set. If everything works correctly it is a race condition. Therefore we moved this flag to redux and decided to set it in reducer in reaction to action that inserts SQLite data to be sure that data and this flag are set "transactionally".
Introduce action to set exclusively storeLoaded field in redux and implement its reduction in native reducer