You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2023-07-24] [$1000] Web - Loader animation appears on clicking resend magic code #22083
Which of our officially supported platforms is this issue occurring on?
Android / native
Android / Chrome
iOS / native
iOS / Safari
MacOS / Chrome / Safari
MacOS / Desktop
Version Number: 1.3.35-5 Reproducible in staging?: y Reproducible in production?: y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation
Please re-state the problem that we are trying to solve in this issue.
Inconsistency in the displaying of the loader in the Sign in button when resending a magic code.
What is the root cause of that problem?
Resending the magic code causes MagicCodeInput to be cleared.
As this is registered as an onChangeText event, this leads to Session.clearAccountMessages(); being called if there is an error present, immediately setting isLoading to false, causing the loader not to be shown in the Sign in button.
In conclusion, the issue is that clearing errors has the unintended side-effect that it automatically sets isLoading to false.
What changes do you think we should make in order to solve the problem?
Preventing this side-effect by adding a parameter to Session.clearAccountMessages(); called shouldClearLoading and setting this to false in this situation. If set to false, isLoading should not be cleared.
This could also be applied to occurrences elsewhere where the intention is to clear errors upon input change (PasswordForm.js:79, LoginForm.js:113, Profile\Contacts\...\BaseValidateCodeForm.js:101),
What alternative solutions did you explore? (Optional)
loadingForm is helpful in telling which form is actually loading and in our case, resending magic code tells that the validate code form (magic code) is the one that is loading.
What changes do you think we should make in order to solve the problem?
There are a couple of solutions, but all of them are similar to each other.
Option 1:
When we resend a magic code, no need to set isLoading to true and loadingForm to CONST.FORMS.VALIDATE_CODE_FORM. We immediately show a timer (30s) after pressing the resend button, so having isLoading as true doesn't do anything.
Option 2:
Keep isLoading to true, but don't set loadingForm to CONST.FORMS.VALIDATE_CODE_FORM.
Option 3:
Keep both, but change loadingForm to a new value, for example, CONST.FORMS.RESEND_VALIDATE_CODE.
Please re-state the problem that we are trying to solve in this issue.
Inconsistency in the displaying of the loader in the Sign in button when resending a magic code.
What is the root cause of that problem?
There's a resendValidateCode function in Session actions.
When we click the resend magic code button, onyx update isLoading to true.
That makes "Sign In" button loading.
changed the title [-][$1000] Web - Loader animation appears on clicking resend magic code[/-][+][HOLD for payment 2023-07-24] [$1000] Web - Loader animation appears on clicking resend magic code[/+]on Jul 17, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.41-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2023-07-24. 🎊
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
External issue reporter
Contributor that fixed the issue
Contributor+ that helped on the issue and/or PR
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
Merged PR within 3 business days of assignment - 50% bonus
Merged PR more than 9 business days after assignment - 50% penalty
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@s77rt] The PR that introduced the bug has been identified. Link to the PR:
[@s77rt] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
[@s77rt] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
[@s77rt] Determine if we should create a regression test for this bug.
[@s77rt] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@MitchExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
A discussion in #expensify-bugs has been started: Not needed. This is not really a bug but a design perspective, we could have caught that if it was brought to discussion with the design team.
Determine if we should create a regression test for this bug: No
Activity
melvin-bot commentedon Jul 2, 2023
Triggered auto assignment to @MitchExpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jul 2, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)samh-nl commentedon Jul 3, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Inconsistency in the displaying of the loader in the Sign in button when resending a magic code.
What is the root cause of that problem?
Resending the magic code causes
MagicCodeInputto be cleared.As this is registered as an
onChangeTextevent, this leads toSession.clearAccountMessages();being called if there is an error present, immediately settingisLoadingtofalse, causing the loader not to be shown in the Sign in button.In conclusion, the issue is that clearing errors has the unintended side-effect that it automatically sets
isLoadingtofalse.App/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js
Lines 154 to 156 in a8d74b9
What changes do you think we should make in order to solve the problem?
Preventing this side-effect by adding a parameter to
Session.clearAccountMessages();calledshouldClearLoadingand setting this tofalsein this situation. If set tofalse,isLoadingshould not be cleared.This could also be applied to occurrences elsewhere where the intention is to clear errors upon input change (
PasswordForm.js:79,LoginForm.js:113,Profile\Contacts\...\BaseValidateCodeForm.js:101),What alternative solutions did you explore? (Optional)
bernhardoj commentedon Jul 3, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Loading spinner is showing when resending magic code.
What is the root cause of that problem?
When we initiate a resend magic code, it will set
account.isLoadingtotrueandaccount.loadingFormtoCONST.FORMS.VALIDATE_CODE_FORM.App/src/libs/actions/Session/index.js
Lines 167 to 178 in b0add94
loadingFormis helpful in telling which form is actually loading and in our case, resending magic code tells that the validate code form (magic code) is the one that is loading.App/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js
Lines 306 to 308 in b0add94
What changes do you think we should make in order to solve the problem?
There are a couple of solutions, but all of them are similar to each other.
Option 1:
When we resend a magic code, no need to set
isLoadingto true andloadingFormtoCONST.FORMS.VALIDATE_CODE_FORM. We immediately show a timer (30s) after pressing the resend button, so havingisLoadingastruedoesn't do anything.Option 2:
Keep
isLoadingtotrue, but don't setloadingFormtoCONST.FORMS.VALIDATE_CODE_FORM.Option 3:
Keep both, but change
loadingFormto a new value, for example,CONST.FORMS.RESEND_VALIDATE_CODE.[-]Web - Loader animation appears on clicking resend magic code[/-][+][$1000] Web - Loader animation appears on clicking resend magic code[/+]melvin-bot commentedon Jul 3, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01f28b124d7b31c045
melvin-bot commentedon Jul 3, 2023
Current assignee @MitchExpensify is eligible for the External assigner, not assigning anyone new.
melvin-bot commentedon Jul 3, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt (
External)gitvolo commentedon Jul 3, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Inconsistency in the displaying of the loader in the Sign in button when resending a magic code.
What is the root cause of that problem?
There's a
resendValidateCodefunction in Session actions.When we click the resend magic code button, onyx update
isLoadingto true.That makes "Sign In" button loading.
App/src/libs/actions/Session/index.js
Lines 167 to 178 in b0add94
What changes do you think we should make in order to solve the problem?
Unless it is intentional, we don't need to set isLoading to true.
27 remaining items
[-][$1000] Web - Loader animation appears on clicking resend magic code[/-][+][HOLD for payment 2023-07-24] [$1000] Web - Loader animation appears on clicking resend magic code[/+]melvin-bot commentedon Jul 17, 2023
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jul 17, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.41-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2023-07-24. 🎊
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
melvin-bot commentedon Jul 17, 2023
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
MitchExpensify commentedon Jul 18, 2023
Added a reminder to pay to my calendar.
Friendly reminder to get the BZ steps above addressed @s77rt - Thank you!
s77rt commentedon Jul 18, 2023
MitchExpensify commentedon Jul 18, 2023
Awesome, thanks @s77rt !
MitchExpensify commentedon Jul 24, 2023
Reporting bonus paid @chiragxarora
C+ paid with bonus to @s77rt
@bernhardoj invited you to the Upwork Job and will close this out once we get payment over to you!
bernhardoj commentedon Jul 24, 2023
Accepted
MitchExpensify commentedon Jul 24, 2023
Thanks! Paid and contract ended 🚀
Great job everyone