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-26] [$1000] Requesting magic code from 'Magic code' page doesn't clear all sign-in errors #21293
Copy expired magic sign-in link from previous interaction
Paste to browser > prefix the link with 'staging' text > press enter
Verify that 'Magic code expired' page is displayed
Switch to the tab where sign-in page is opened
Click on Sign-in button
Switch to the tab where 'Magic code expired' page is displayed
Click on 'request a new code here!' link
Switch to the tab where sign-in page is opened
Expected Result:
All error messages including 'Please enter your magic code' should be cleared in the same manner as requesting magic code from sign-in page clears all errors
Actual Result:
'Please enter your magic code' error message is not cleared
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
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.30-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.
Request a new magic code does not clear sign in form errors on other tab.
What is the root cause of that problem?
When user opens an expired link, and clicks request a new code here!, This calls Session.resendValidateCode(), which clears error field in ONYXKEYS.ACCOUNT key in onyx datastore.
hasError in BaseValidateCodeForm is based on this, but errorText is dependent based on formError in the component state which is not updated when we request magic code from other component.
What changes do you think we should make in order to solve the problem?
There are two props related to error field. hasError and errorText. I believe, it should be enough to just rely on hasError to display error message. In fact these two props should be synced, i.e., when hasError is true, errorText should contain an error message, and when it is false, it should be empty.
changed the title [-]Requesting magic code from 'Magic code' page doesn't clear all sing-in errors[/-][+][$1000] Requesting magic code from 'Magic code' page doesn't clear all sing-in errors[/+]on Jun 22, 2023
changed the title [-][$1000] Requesting magic code from 'Magic code' page doesn't clear all sign-in errors[/-][+][HOLD for payment 2023-07-26] [$1000] Requesting magic code from 'Magic code' page doesn't clear all sign-in errors[/+]on Jul 19, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.42-26 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-26. 🎊
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
Activity
melvin-bot commentedon Jun 22, 2023
Triggered auto assignment to @twisterdotcom (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jun 22, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)mdneyazahmad commentedon Jun 22, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Request a new magic code does not clear sign in form errors on other tab.
What is the root cause of that problem?
When user opens an expired link, and clicks
request a new code here!, This callsSession.resendValidateCode(), which clears error field inONYXKEYS.ACCOUNTkey in onyx datastore.hasErrorinBaseValidateCodeFormis based on this, buterrorTextis dependent based onformErrorin the component state which is not updated when we request magic code from other component.App/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js
Lines 246 to 247 in e6c4b4e
MagicCodeInputjust depend onformErrorprop therefore this error error is not cleared.App/src/components/MagicCodeInput.js
Line 354 in e6c4b4e
What changes do you think we should make in order to solve the problem?
There are two props related to error field.
hasErroranderrorText. I believe, it should be enough to just rely onhasErrorto display error message. In fact these two props should be synced, i.e., whenhasErroris true,errorTextshould contain an error message, and when it is false, it should be empty.These are the changes:
App/src/components/MagicCodeInput.js
Line 316 in e6c4b4e
What alternative solutions did you explore? (Optional)
None
tienifr commentedon Jun 22, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Requesting magic code from 'Magic code' page doesn't clear all sing-in errors
What is the root cause of that problem?
We're using component state to show the error
App/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js
Lines 232 to 233 in 9bef507
we just only clear error state when users click
Didn't receive a magic code?on login page.That why when users click
resend validate codefrom Magic code page, the errors still are shown in the login page.What changes do you think we should make in order to solve the problem?
change function
resendValidateCodetomove other code to new function like clearData, then execute this function when props.account.loadingForm === CONST.FORMS.VALIDATE_CODE_FORM
Result
Screen.Recording.2023-06-22.at.17.58.35.mp4
twisterdotcom commentedon Jun 22, 2023
Chatting in Slack on this one. DIdn't realize this could be done. Let's do it!
[-]Requesting magic code from 'Magic code' page doesn't clear all sing-in errors[/-][+][$1000] Requesting magic code from 'Magic code' page doesn't clear all sing-in errors[/+]melvin-bot commentedon Jun 22, 2023
Job added to Upwork: https://www.upwork.com/jobs/~018f0afc70ce23ee77
melvin-bot commentedon Jun 22, 2023
Current assignee @twisterdotcom is eligible for the External assigner, not assigning anyone new.
melvin-bot commentedon Jun 22, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @aimane-chnaif (
External)44 remaining items
melvin-bot commentedon Jul 18, 2023
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
[-][$1000] Requesting magic code from 'Magic code' page doesn't clear all sign-in errors[/-][+][HOLD for payment 2023-07-26] [$1000] Requesting magic code from 'Magic code' page doesn't clear all sign-in errors[/+]melvin-bot commentedon Jul 19, 2023
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jul 19, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.42-26 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-26. 🎊
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:
twisterdotcom commentedon Jul 25, 2023
Payment due tomorrow.
External issue reporter: @Natnael-Guchima due $250: https://www.upwork.com/nx/wm/pre-hire/c/8577561/offer/25751090
Contributor that fixed the issue: @tienifr due $1000: https://www.upwork.com/nx/wm/workroom/34187190/overview
Contributor+ that helped on the issue and/or PR: @aimane-chnaif due $1000: https://www.upwork.com/nx/wm/workroom/34202522/overview
twisterdotcom commentedon Jul 26, 2023
All paid out.