Skip to content

[HOLD for payment 2023-08-21] [$1000] Contact Method – Input dashes remain red, instead turning to grey upon deletion of any number. #23756

Closed

Description

@kavimuru

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Open your profile.
  2. Click on "Contact methods".
  3. Click on "New contact method".
  4. Add a new contact and proceed to the next step.
  5. Enter an invalid magic code to trigger an error, causing the dashes to turn red.
  6. Delete any number.
  7. 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

Bug.mp4
Recording.1373.mp4

Expensify/Expensify Issue URL:
Issue reported by: @usmantariq96
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1690438628680299

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016c5402df1f6143e0
  • Upwork Job ID: 1684857239303507968
  • Last Price Increase: 2023-08-04
  • Automatic offers:
    • fedirjh | Reviewer | 26031002
    • hoangzinh | Contributor | 26031005

Activity

  1. added
    Daily
    Bug
    on Jul 27, 2023
  2. melvin-bot commented on Jul 27, 2023

    @melvin-bot

    Triggered auto assignment to @conorpendergrast (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  3. melvin-bot commented on Jul 27, 2023

    @melvin-bot

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
    • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
      • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
    • This bug is reproducible using the reproduction steps in the OP. S/O
      • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
      • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
    • This issue is filled out as thoroughly and clearly as possible
      • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
    • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
  4. ygshbht commented on Jul 28, 2023

    @ygshbht
    Contributor

    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}

    <MagicCodeInput
    autoComplete={props.autoComplete}
    ref={inputValidateCodeRef}
    label={props.translate('common.magicCode')}
    name="validateCode"
    value={validateCode}
    onChangeText={onTextInput}
    errorText={formError.validateCode ? props.translate(formError.validateCode) : ErrorUtils.getLatestErrorMessage(props.account)}
    hasError={!_.isEmpty(validateLoginError)}
    onFulfill={validateAndSubmitForm}
    autoFocus
    shouldDelayFocus={shouldDelayFocus}
    />

    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:

    onChangeText={(...args) => {
        User.clearContactMethodErrors(props.contactMethod, 'validateLogin');
        onTextInput(...args);
    }}
    
    

    By doing so, we ensure the error state is cleared whenever the input changes, making the behavior consistent with other sections.

  5. spcheema commented on Jul 28, 2023

    @spcheema
    Contributor

    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 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.

  6. added
    External
    on Jul 28, 2023
  7. 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
  8. melvin-bot commented on Jul 28, 2023

    @melvin-bot
  9. added
    Help Wanted
    on Jul 28, 2023
  10. melvin-bot commented on Jul 28, 2023

    @melvin-bot

    Current assignee @conorpendergrast is eligible for the External assigner, not assigning anyone new.

  11. melvin-bot commented on Jul 28, 2023

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh (External)

  12. 41 remaining items

  13. added
    Daily
    and removed
    Weekly
    Daily
    on Aug 21, 2023
  14. conorpendergrast commented on Aug 21, 2023

    @conorpendergrast

    @usmantariq96 Hello! Please apply to the Upwork job for your role as reporter ($250)
    @fedirjh Please accept the offer!

  15. conorpendergrast commented on Aug 21, 2023

    @conorpendergrast

    Payouts due:

    Eligible for 50% #urgency bonus? Yes

    Upwork job is here.

  16. usmantariq96 commented on Aug 22, 2023

    @usmantariq96

    @conorpendergrast applied
    Thanks

  17. fedirjh commented on Aug 22, 2023

    @fedirjh
    Contributor

    BugZero Checklist:


    Regression Test Proposal

    1. Navigate to Settings -> Profile -> Contact methods
    2. Click on New contact method.
    3. Add a new contact.
    4. Navigate to the newly added contact method to verify it.
    5. Enter an invalid magic code to trigger an error, causing the dashes to turn red.
    6. Delete any magic code digit.
    7. Verify that the red dashes disappear, and the error is cleared.

    Do we agree 👍 or 👎

  18. stitesExpensify commented on Aug 24, 2023

    @stitesExpensify
    Contributor

    Are we all good here @conorpendergrast?

  19. conorpendergrast commented on Aug 25, 2023

    @conorpendergrast

    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 👍

  20. usmantariq96 commented on Aug 25, 2023

    @usmantariq96

    @conorpendergrast accepted with thanks

  21. conorpendergrast commented on Aug 25, 2023

    @conorpendergrast

    And we are done, thank you everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions