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-08-21] [$1000] Contact Method – Input dashes remain red, instead turning to grey upon deletion of any number. #23756
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Enter an invalid magic code to trigger an error, causing the dashes to turn red.
Delete any number.
Notice that the dashes remain red, while in other sections, they turn to grey upon deleting any number.
Expected Result:
The dashes should turn to grey upon deletion of a number, similar to how it works in other sections.
Actual Result:
The dashes remain red upon deleting any number, while in other sections, they turn to grey
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.46-2 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.
When deleting a number from an invalid magic code in the 'Contact methods' section, the input dashes remain red instead of turning grey as is the behavior in other sections.
What is the root cause of that problem?
The root cause of the problem is that the current implementation does not clear the error once the input is changed. The error state is retained, and therefore the dashes remain red.
What changes do you think we should make in order to solve the problem?
To solve this issue, we need to introduce functionality to clear the error when the input changes. This can be done by modifying the onChangeText function in the following way:
Please re-state the problem that we are trying to solve in this issue.
Contact Method – Input dashes remain red, instead turning to grey upon deletion of any number.
What is the root cause of that problem?
Based on the current implementation, whenever a user enters an incorrect magic code, the app shows an error and updates validateLogin in Onyx data (loginData). Based on that it shows an error red dot on the user profile to indicate an error.
Now the same error info is used to show an error indicator to magic code inputs even if the input is empty.
What changes do you think we should make in order to solve the problem?
There are two options to consider:
Option 1:
If we still want to keep the red dot on the user profile and hide the red border from hiding input along with the error message then
Show red border only when there magic input text length equal to MAGIC_CODE_LENGTH and a user has validateLogin error
Show error message as-is
On BaseValidateCodeForm.js update onInputChange callback.
Option 2:
Clear validateLogin data from OnyxData it'll hide the following:
Remove the red border from magic code input fields
Remove error message Failed to validate contact method with given magic code. Please request a new code and try again.
Remove the red dot from the profile as well
BaseValidateCodeForm.js
Call User.clearContactMethodErrors(props.contactMethod, 'validateLogin') on input change callback.
I think validateLogin is intentionally prevented from being cleared (unless a user refresh page) to give a user indication that there is an error related to the profile.
But that error clears whenever a user refresh the page and onyx data sync with API response.
What alternative solutions did you explore? (Optional)
N/A
I don't find any value considering the red dot does clean on refresh unless I misunderstood. May be clear the error from Onyx on input change.
changed the title [-]Contact Method – Input dashes remain red, instead turning to grey upon deletion of any number.[/-][+][$1000] Contact Method – Input dashes remain red, instead turning to grey upon deletion of any number.[/+]on Jul 28, 2023
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Activity
melvin-bot commentedon Jul 27, 2023
Triggered auto assignment to @conorpendergrast (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jul 27, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)ygshbht commentedon Jul 28, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
When deleting a number from an invalid magic code in the 'Contact methods' section, the input dashes remain red instead of turning grey as is the behavior in other sections.
What is the root cause of that problem?
The root cause of the problem is that the current implementation does not clear the error once the input is changed. The error state is retained, and therefore the dashes remain red.
onChangeText={onTextInput}App/src/pages/settings/Profile/Contacts/ValidateCodeForm/BaseValidateCodeForm.js
Lines 131 to 143 in 975146f
What changes do you think we should make in order to solve the problem?
To solve this issue, we need to introduce functionality to clear the error when the input changes. This can be done by modifying the
onChangeTextfunction in the following way:By doing so, we ensure the error state is cleared whenever the input changes, making the behavior consistent with other sections.
spcheema commentedon Jul 28, 2023
Proposed solution
Please re-state the problem that we are trying to solve in this issue.
Contact Method – Input dashes remain red, instead turning to grey upon deletion of any number.
What is the root cause of that problem?
Based on the current implementation, whenever a user enters an incorrect magic code, the app shows an error and updates
validateLoginin Onyx data (loginData). Based on that it shows an error red dot on the user profile to indicate an error.Now the same error info is used to show an error indicator to magic code inputs even if the input is empty.
What changes do you think we should make in order to solve the problem?
There are two options to consider:
Option 1:
If we still want to keep the red dot on the user profile and hide the red border from hiding input along with the error message then
validateLoginerrorOn
BaseValidateCodeForm.jsupdateonInputChangecallback.Option 2:
Clear
validateLogindata from OnyxData it'll hide the following:Failed to validate contact method with given magic code. Please request a new code and try again.BaseValidateCodeForm.js
Call
User.clearContactMethodErrors(props.contactMethod, 'validateLogin')on input change callback.I think
validateLoginis intentionally prevented from being cleared (unless a user refresh page) to give a user indication that there is an error related to the profile.But that error clears whenever a user refresh the page and onyx data sync with API response.
What alternative solutions did you explore? (Optional)
N/A
I don't find any value considering the red dot does clean on refresh unless I misunderstood. May be clear the error from Onyx on input change.
[-]Contact Method – Input dashes remain red, instead turning to grey upon deletion of any number.[/-][+][$1000] Contact Method – Input dashes remain red, instead turning to grey upon deletion of any number.[/+]melvin-bot commentedon Jul 28, 2023
Job added to Upwork: https://www.upwork.com/jobs/~016c5402df1f6143e0
melvin-bot commentedon Jul 28, 2023
Current assignee @conorpendergrast is eligible for the External assigner, not assigning anyone new.
melvin-bot commentedon Jul 28, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh (
External)41 remaining items
conorpendergrast commentedon Aug 21, 2023
@usmantariq96 Hello! Please apply to the Upwork job for your role as reporter ($250)
@fedirjh Please accept the offer!
conorpendergrast commentedon Aug 21, 2023
Payouts due:
Eligible for 50% #urgency bonus? Yes
Upwork job is here.
usmantariq96 commentedon Aug 22, 2023
@conorpendergrast applied
Thanks
fedirjh commentedon Aug 22, 2023
BugZero Checklist:
Regression Test Proposal
New contact method.Do we agree 👍 or 👎
stitesExpensify commentedon Aug 24, 2023
Are we all good here @conorpendergrast?
conorpendergrast commentedon Aug 25, 2023
Sorry folks, I have a few things left - this week has gotten away from me.
Once @usmantariq96 has accepted the offer and been paid, I will close this 👍
usmantariq96 commentedon Aug 25, 2023
@conorpendergrast accepted with thanks
conorpendergrast commentedon Aug 25, 2023
And we are done, thank you everyone!