Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: Removes routerHistory from Redux store #573

Merged
merged 6 commits into from
Apr 9, 2024

Conversation

tuliomir
Copy link
Collaborator

@tuliomir tuliomir commented Apr 3, 2024

The next version of Redux throws an error by default whenever there are non-serializable objects in its Store ( more about this on this article ). This PR is one in a series of PRs that aim to refactor all of those instances before the upgrade.

The routerHistory property stored is currently used for navigating inside our Sagas. The proposed solution is to:

  • Create a navigateTo property on the store
  • Create a useEffect() inside the App.js screen listening to changes on this property
  • App.js becomes responsible for navigating whenever a background task requests it to

Acceptance Criteria

  • The routerHistory should not be present on the Redux Store

Security Checklist

  • Make sure you do not include new dependencies in the project unless strictly necessary and do not include dev-dependencies as production ones. More dependencies increase the possibility of one of them being hijacked and affecting us.

@tuliomir tuliomir requested a review from andreabadesso April 3, 2024 21:55
@tuliomir tuliomir self-assigned this Apr 3, 2024
@tuliomir tuliomir requested a review from pedroferreira1 as a code owner April 3, 2024 21:55
Copy link

codecov bot commented Apr 3, 2024

Codecov Report

Attention: Patch coverage is 8.69565% with 21 lines in your changes are missing coverage. Please review.

Project coverage is 9.18%. Comparing base (7c2f02a) to head (9f18519).
Report is 2 commits behind head on master.

❗ Current head 9f18519 differs from pull request most recent head a7c73d8. Consider uploading reports for the commit a7c73d8 to get more accurate results

Files Patch % Lines
src/sagas/wallet.js 0.00% 7 Missing ⚠️
src/App.js 0.00% 4 Missing and 1 partial ⚠️
src/reducers/index.js 33.33% 2 Missing ⚠️
src/sagas/atomicSwap.js 0.00% 1 Missing ⚠️
src/screens/ChoosePassphrase.js 0.00% 1 Missing ⚠️
src/screens/LoadWallet.js 0.00% 1 Missing ⚠️
src/screens/LockedWallet.js 0.00% 1 Missing ⚠️
src/screens/NewWallet.js 0.00% 1 Missing ⚠️
src/screens/Server.js 0.00% 1 Missing ⚠️
src/utils/wallet.js 0.00% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##           master    #573   +/-   ##
======================================
  Coverage    9.17%   9.18%           
======================================
  Files         113     113           
  Lines        5273    5270    -3     
  Branches      703     703           
======================================
  Hits          484     484           
+ Misses       4121    4119    -2     
+ Partials      668     667    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/App.js Outdated Show resolved Hide resolved
src/sagas/wallet.js Show resolved Hide resolved
@tuliomir tuliomir merged commit 3b20991 into master Apr 9, 2024
1 check passed
@tuliomir tuliomir deleted the refactor/routerhistory-store branch April 9, 2024 14:06
@tuliomir tuliomir mentioned this pull request May 3, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants