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

feat: [IOPLT-724] Split up the backend status for better handling #6296

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

CrisTofani
Copy link
Contributor

@CrisTofani CrisTofani commented Oct 17, 2024

Short description

This PR aims to split the backendStatus reducer and store section into 4 different reducers

List of changes proposed in this pull request

  • Removed backendStatus reducer
  • Created remoteConfig, sectionStatus, backendInfo, statusMessages reducers

How to test

Anything should work properly as usual after changes.

@pagopa-github-bot pagopa-github-bot changed the title [IOPLT-724] Split up the backend status for better handling feat: [IOPLT-724] Split up the backend status for better handling Oct 17, 2024
@pagopa-github-bot
Copy link
Collaborator

pagopa-github-bot commented Oct 17, 2024

Affected stories

  • 🌟 IOPLT-724: Come DEV voglio suddividere la gestione delle configurazioni remote sull'APP per ottimizzarne le evoluzioni future

Generated by 🚫 dangerJS against 40650da

Copy link

codecov bot commented Oct 17, 2024

Codecov Report

Attention: Patch coverage is 58.28877% with 78 lines in your changes missing coverage. Please review.

Project coverage is 46.98%. Comparing base (4f204b4) to head (40650da).
Report is 670 commits behind head on master.

Files with missing lines Patch % Lines
ts/store/reducers/backendStatus/remoteConfig.ts 46.61% 61 Missing and 2 partials ⚠️
ts/store/reducers/backendStatus/backendInfo.ts 68.75% 5 Missing ⚠️
ts/store/reducers/backendStatus/statusMessages.ts 68.75% 5 Missing ⚠️
ts/screens/modal/SystemOffModal.tsx 0.00% 2 Missing ⚠️
ts/store/reducers/backendStatus/sectionStatus.ts 93.10% 2 Missing ⚠️
ts/components/wallet/PaymentMethodsList.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6296      +/-   ##
==========================================
- Coverage   48.42%   46.98%   -1.44%     
==========================================
  Files        1488     1820     +332     
  Lines       31617    36943    +5326     
  Branches     7669     8845    +1176     
==========================================
+ Hits        15311    17359    +2048     
- Misses      16238    19519    +3281     
+ Partials       68       65       -3     
Files with missing lines Coverage Δ
ts/components/SectionStatus/index.tsx 100.00% <ø> (+2.77%) ⬆️
ts/components/SectionStatus/modal/index.tsx 61.70% <ø> (ø)
ts/components/screens/BaseHeader.tsx 78.37% <ø> (-5.63%) ⬇️
...s/components/screens/BaseScreenComponent/index.tsx 62.96% <ø> (-11.12%) ⬇️
...code/components/BarcodeScanBaseScreenComponent.tsx 77.77% <ø> (-1.59%) ⬇️
ts/features/barcode/screens/BarcodeScanScreen.tsx 1.38% <ø> (-0.07%) ⬇️
ts/features/bonus/cgn/screens/CgnDetailScreen.tsx 4.54% <ø> (-9.41%) ⬇️
...screens/activation/CgnCTAStartActivationScreen.tsx 16.00% <ø> (-6.73%) ⬇️
...ures/bonus/common/screens/AvailableBonusScreen.tsx 7.69% <ø> (-1.24%) ⬇️
ts/features/cieLogin/store/selectors/index.ts 66.66% <ø> (+16.66%) ⬆️
... and 87 more

... and 1358 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f620db4...40650da. Read the comment docs.

return state;
};

export const backendInfoSelector = (state: GlobalState) => state.backendInfo;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this selector is "a thing of the past" and it is used only in ts/sagas/backendStatus.ts, should we remove it and refactor the latter to use isBackendServicesStatusOffSelector and a new deadsCounterSelector?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe would face this in a more dedicated task, I would prefer to avoid side effects due to un-needed refactoring at the moment, what do you think?

ts/features/fims/history/store/selectors/index.ts Outdated Show resolved Hide resolved
ts/features/pn/utils/index.ts Outdated Show resolved Hide resolved
ts/features/tos/store/selectors/index.ts Outdated Show resolved Hide resolved
@@ -49,8 +49,9 @@ export function* backendStatusWatcherLoop(
backendStatusSaga,
getStatus
);
const currentState: ReturnType<typeof backendServicesStatusSelector> =
yield* select(backendServicesStatusSelector);
const currentState: ReturnType<typeof backendInfoSelector> = yield* select(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment on the reducer's file about removing this one in favour of two distinct selectors

ts/sagas/startup.ts Outdated Show resolved Hide resolved
ts/screens/modal/SystemOffModal.tsx Outdated Show resolved Hide resolved
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.

3 participants