Skip to content

[HOLD for payment 2024-01-26] [$500] Settings - Red dot remains after error is cleared #33021

Closed

Description

@lanitochka17

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


Version Number: 1.4.12-0
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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Issue found when executing PR #31713

Action Performed:

Pre-requisite: user must be logged in

  1. On staging, enable "Simulate failing network requests" in Settings > Preferences
  2. Go to Settings > Profile > Contact method
  3. Add a phone number as a new contact method
  4. Wait for the pending add operation to fail
  5. Once you see the red dot, click on the contact method and clear the error

Expected Result:

The red dot should disappear after the error is cleared

Actual Result:

The red dot remains on user avatar on the home screen and in settings

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • Windows: Chrome
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6312254_1702503451411.bandicam_2023-12-13_15-07-14-733.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~012ec660a67cb6d223
  • Upwork Job ID: 1735053356937179136
  • Last Price Increase: 2024-01-03
  • Automatic offers:
    • ntdiary | Reviewer | 28089273
    • tienifr | Contributor | 28089274

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Dec 13, 2023
  2. changed the title [-]All - Settings - Red dot remains after error is cleared[/-] [+][$500] All - Settings - Red dot remains after error is cleared[/+] on Dec 13, 2023
  3. melvin-bot commented on Dec 13, 2023

    @melvin-bot

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

  4. melvin-bot commented on Dec 13, 2023

    @melvin-bot
  5. melvin-bot commented on Dec 13, 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
  6. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Dec 13, 2023
  7. melvin-bot commented on Dec 13, 2023

    @melvin-bot

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

  8. AmjedNazzal commented on Dec 13, 2023

    @AmjedNazzal
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    All - Settings - Red dot remains after error is cleared

    What is the root cause of that problem?

    In deleteContactMethod, we are clearing errorFields.deletedLogin but we aren't clearing errorFields.addedLogin which is a part of the failureData of addNewContactMethodAndNavigate.

    When we delete a contact method, we expect a green dot to show up while the deletion is being processed, this is added intentionally by using pendingFields.deletedLogin: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE as shown below in the code, however this green dot is override by red dot because of errorFields.addedLogin

    function deleteContactMethod(contactMethod, loginList) {
    const oldLoginData = loginList[contactMethod];
    const optimisticData = [
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: ONYXKEYS.LOGIN_LIST,
    value: {
    [contactMethod]: {
    partnerUserID: '',
    errorFields: {
    deletedLogin: null,
    },
    pendingFields: {
    deletedLogin: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,

    What changes do you think we should make in order to solve the problem?

    We should clear that errorField on contact method deletion so the red dot doesn't show up during the deletion process

    function deleteContactMethod(contactMethod, loginList) {
        ....
        value: {
            [contactMethod]: {
                ....
                errorFields: {
                    deletedLogin: null,
                    addedLogin: null,
                },

    Result

    Screen.Recording.2023-12-14.at.2.31.09.AM.mov
  9. sfurqan2 commented on Dec 14, 2023

    @sfurqan2

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Red dot remains after error is cleared when network connection is simulating slow network requests

    What is the root cause of that problem?

    The root cause of the problem is that in Contact Page there is an additional check which hides new contact requests with pendingAction "delete".

    const hideChildren = shouldHideOnDelete && !isOffline && pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE && !hasErrors;

    However, this check is missing from userUtils "hasLoginListError" function.

    function hasLoginListError(loginList: Record<string, Login>): boolean {
        return Object.values(loginList).some((loginData) => Object.values(loginData.errorFields ?? {}).some((field) => Object.keys(field ?? {}).length > 0));
    }

    What changes do you think we should make in order to solve the problem?

    Logic on both ends should be kept consistent so I would suggest we implement the same checks in userUtils and call it. This will maintain the DRY principle as well as is easier to maintain.

    What alternative solutions did you explore? (Optional)

    N/A

  10. melvin-bot commented on Dec 14, 2023

    @melvin-bot

    📣 @sfurqan2! 📣
    Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
    Please follow these steps:

    1. Make sure you've read and understood the contributing guidelines.
    2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
    3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
    4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
      Screen Shot 2022-11-16 at 4 42 54 PM
      Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
    
  11. sfurqan2 commented on Dec 14, 2023

    @sfurqan2

    Contributor details
    Your Expensify account email: sfurqan1999@gmail.com
    Upwork Profile Link: https://www.upwork.com/freelancers/~0163c31a5a31c72f3f

  12. 58 remaining items

  13. dangrous commented on Jan 29, 2024

    @dangrous
    Contributor

    Hi! I just wanted to call it out here - I'm closing out #34758 as not a bug, but I'm pretty sure it means that QA was never able to successfully QA this issue. It would be great if y'all could make sure this works as expected on this issue!

  14. danieldoglas commented on Jan 31, 2024

    @danieldoglas
    Contributor

    @ntdiary let's do the bugzero checklist here

  15. michaelhaxhiu commented on Jan 31, 2024

    @michaelhaxhiu
    Contributor

    Next step is with @ntdiary to do the regression steps

  16. ntdiary commented on Feb 1, 2024

    @ntdiary
    Contributor

    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:

    I think this is a small edge case we overlooked during the development of the contact details page, so it's okay to just leave a comment in the original PR, no regression test is needed. :)

  17. added
    BugSomething is broken. Auto assigns a BugZero manager.
    and removed
    BugSomething is broken. Auto assigns a BugZero manager.
    on Feb 1, 2024
  18. melvin-bot commented on Feb 1, 2024

    @melvin-bot

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

  19. danieldoglas commented on Feb 1, 2024

    @danieldoglas
    Contributor

    cc @miljakljajic can you please proceed with the payment on this issue? Thanks!

  20. miljakljajic commented on Feb 2, 2024

    @miljakljajic
    Contributor

    Paid and paid!

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions