-
Notifications
You must be signed in to change notification settings - Fork 106
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(Bonus Pagamenti Digitali): [#176318970] Avoid call bpd API if the user is not enrolled #2663
feat(Bonus Pagamenti Digitali): [#176318970] Avoid call bpd API if the user is not enrolled #2663
Conversation
Affected stories
|
Codecov Report
@@ Coverage Diff @@
## master #2663 +/- ##
==========================================
+ Coverage 51.49% 51.54% +0.05%
==========================================
Files 730 730
Lines 20724 20731 +7
Branches 3967 3967
==========================================
+ Hits 10671 10686 +15
+ Misses 10009 10001 -8
Partials 44 44
Continue to review full report at Codecov.
|
@@ -34,6 +35,7 @@ function* enrollToBpdWorker() { | |||
); | |||
|
|||
if (enrollResult.payload.enabled) { | |||
yield put(bpdAllData.request()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this request creates a side effect:
bpdAllData
makes few requests and it also asks for the citizen activation status. The response (since the citizen is enrolled) invalidates the onboarding state (it becomes false due to this condition )
I mainly noted this side effect on the 2nd CTA button of this screen (UI thinks the user is already enrolled)
before | now |
---|---|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tnx for the catch, solved in d4ede1e, removing the condition (legacy, not needed anymore)
…970-avoid-call-bpd-api-if-the-user-is-not-enrolled
…l-bpd-api-if-the-user-is-not-enrolled' into 176318970-avoid-call-bpd-api-if-the-user-is-not-enrolled
Short description
This pr removes the call to the BPD API if the user is not enrolled to bpd ( atm the user should never see a closed period if is not enrolled to bpd anymore)
List of changes proposed in this pull request
loadBpdData
in order to avoid to call others bpd API if the user is not enrolledbpdLoadRaking
in order to handle the return code404
as an empty array of periods.enrollToBpdWorker
in order to request the updated bpd data after the enroll of the userbpdPeriodsReducer
in order to clean the periods state after the user unsubscribe from bpd.Expected behaviours:
bpd/io/citizen
is calledbpd/io/citizen/ranking
return 404 -> the user will see a "ranking not ready"ts/features/bonus/bpd/saga/networking/__test__/loadBpdData.test.ts