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

fix: refactor history module initialization to fix conflict with global state #1333

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MosCD3
Copy link
Contributor

@MosCD3 MosCD3 commented Nov 27, 2024

Summary of Changes

Addressing issue

The way history feature was initialized in the splash screen was causing a race condition on the PersistentStorage which causes some glitches. One of them was resetting the store even after store is initialized with proper values.
After revisiting the whole flow, I found no need to use the state for setting history feature flag and we can rely only on the injectable flag, more clean and hassle free approach. Also fixed a re-render loop on the history cards page

Screenshots, videos, or gifs

Replace this text with embedded media for UI changes if they are included in this PR. If there are none, simply enter N/A

Breaking change guide

Replace this text with any breaking changes included in this PR along with how to address them in downstream projects. If there are none, simply enter N/A

Related Issues

Replace this text with issue #'s that are relevant to this PR. If there are none, simply enter N/A

Pull Request Checklist

Tick all boxes below to demonstrate that you have completed the respective task. If the item does not apply to your this PR check it anyway to make it apparent that there's nothing to do.

  • All commits contain a DCO Signed-off-by line (we use the DCO GitHub app to enforce this)
  • If applicable, screenshots, gifs, or video are included for UI changes
  • If applicable, breaking changes are described above along with how to address them
  • Updated documentation as needed for changed code and new or modified features
  • Added sufficient tests so that overall code coverage is not reduced

If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!

Pro Tip 🤓

  • Read our contribution guide at least once; it will save you a few review cycles!
  • Your PR will likely not be reviewed until all the above boxes are checked and all automated checks have passed

Signed-off-by: Mostafa Gamal <[email protected]>
@MosCD3 MosCD3 marked this pull request as ready for review November 27, 2024 05:23
Signed-off-by: Mostafa Gamal <[email protected]>
Copy link

sonarcloud bot commented Nov 27, 2024

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 29.41176% with 12 lines in your changes missing coverage. Please review.

Project coverage is 55.63%. Comparing base (f475eed) to head (b9786f5).
Report is 38 commits behind head on main.

Files with missing lines Patch % Lines
...legacy/core/App/modules/history/ui/HistoryPage.tsx 0.00% 9 Missing ⚠️
packages/legacy/core/App/navigators/HomeStack.tsx 0.00% 2 Missing ⚠️
packages/legacy/core/App/screens/Splash.tsx 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1333      +/-   ##
==========================================
- Coverage   57.12%   55.63%   -1.49%     
==========================================
  Files         204      217      +13     
  Lines        6980     7603     +623     
  Branches     1978     2159     +181     
==========================================
+ Hits         3987     4230     +243     
- Misses       2971     3351     +380     
  Partials       22       22              

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants