Skip to content

[HOLD for payment 2024-04-05] [$500] IOU-Error message remains on IOU report even same error message is dismissed from 1:1 #34189

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

Action Performed:

  1. Log in with separate accounts in the main testing device and a secondary device
  2. In the main testing device create an IOU with a user
  3. Disable the internet connection in the main testing device
  4. In the main testing device (while offline) cancel the IOU
  5. In the secondary device (online) mark the IOU as paid with the option "Settled up elsewhere"
  6. Enable the internet connection in the main testing device
  7. Verify a red dot appears on the chat in LHN
  8. Tap the X from the conversation
  9. Go to IOU report

Expected Result:

Since User dismiss the X error should not appear into IOU report

Actual Result:

Error message remains on IOU report even same error message is dismissed from 1:1

Workaround:

Unknown

Platforms:

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

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

Screenshots/Videos

Add any screenshot/video evidence

Bug6337113_1704833301543.Recording__1724.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~019c035b355c60f48e
  • Upwork Job ID: 1754884327412707328
  • Last Price Increase: 2024-02-27

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 9, 2024
  2. changed the title [-]Android - IOU-Error message remains on IOU report even same error message is dismissed from 1:1[/-] [+][$500] Android - IOU-Error message remains on IOU report even same error message is dismissed from 1:1[/+] on Jan 9, 2024
  3. melvin-bot commented on Jan 9, 2024

    @melvin-bot
  4. melvin-bot commented on Jan 9, 2024

    @melvin-bot

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

  5. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 9, 2024
  6. melvin-bot commented on Jan 9, 2024

    @melvin-bot

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

  7. tienifr commented on Jan 10, 2024

    @tienifr
    Contributor

    Proposal

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

    Error message remains on IOU report even same error message is dismissed from 1:1

    What is the root cause of that problem?

    When we failed to delete the money request, there'll be 2 different errors created on the IOU report and the chat report here and here

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

    When we generate the errors on IOU report and chat report, generate them with the same microseconds since they are basically 1 single error.

    When clearing the error from either the IOU report or the chat report, optionally check if the error content is iou.error.genericDeleteFailureMessage, if true, we'll find a report action from the other report (if IOU report then we find in chat report and vice versa) that has an error with the same microseconds (and error content), and clear that error as well.

    Detail implementation

    1. Define the errorKey
        const errorKey = DateUtils.getMicroseconds();
    
    1. Store the error for the action itself
      Update this line here to
    errors: {
                            [errorKey]: 'iou.error.genericDeleteFailureMessage'
                        }
    

    and here to

    errors: {
                            [errorKey]: 'iou.error.genericDeleteFailureMessage'
                        },
    
    1. Create new function named clearAllRelatedReportActionErrors in libs/action/ReportActions.ts to clear the error from action itself and children/parent actions

    2. Update onClose to use clearAllRelatedReportActionErrors

    onClose={() => ReportActions.clearAllRelatedReportActionErrors(props.report.reportID, props.action)}
    

    Here's the test branch: https://github.com/tienifr/App/tree/fix/34189

    What alternative solutions did you explore? (Optional)

    The same approach listed above can be applied to many other scenarios where there's an error that occurs in multiple places but actually are the same error.

    Another approach is to make microsecond errors an error object instead of just a text/translation key. In that object we can include metadata on where else this same error is added and use that to clear the error. Or we can even create a dedicated errors_${microseconds} key in Onyx to store the metadata, and when deleting we cross check that object to see if there's anywhere else this error needs to be deleted.

    Result

    Screen.Recording.2024-01-22.at.18.00.00.mov
  8. codebycarlos commented on Jan 10, 2024

    @codebycarlos

    Agree with @tienifr's diagnosis. 👍

    Not sure about adding logic to sync error deletion across reports though, adds a fair bit of complexity and potential for more bugs.

    Ideally, if we want the error to behave as it belongs to a single entity (say IOU report) and displayed in multiple places, we should reflect that in the data and component structure. Data normalisation, as opposed to duplication. Otherwise, we may find this type of issue props up again.

    Thoughts?

  9. kaushiktd commented on Jan 11, 2024

    @kaushiktd
    Contributor

    I agree with @tienifr and @codebycarlos. I checked his proposal.
    The proposal advises that the data structure be normalized. This would eliminate duplicate errors and speed up the resolution process. The solution aims for simplicity and effectiveness by providing consistent error generation with shared microseconds and updating dismissal logic to eliminate errors from both reports at the same time.

  10. melvin-bot commented on Jan 15, 2024

    @melvin-bot

    @alexpensify, @Santhosh-Sellavel Eep! 4 days overdue now. Issues have feelings too...

  11. 92 remaining items

  12. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Mar 29, 2024
  13. changed the title [-][$500] IOU-Error message remains on IOU report even same error message is dismissed from 1:1[/-] [+][HOLD for payment 2024-04-05] [$500] IOU-Error message remains on IOU report even same error message is dismissed from 1:1[/+] on Mar 29, 2024
  14. melvin-bot commented on Mar 29, 2024

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  15. melvin-bot commented on Mar 29, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.57-5 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 2024-04-05. 🎊

    For reference, here are some details about the assignees on this issue:

    • @tienifr requires payment (Needs manual offer from BZ)
    • @DylanDylann requires payment (Needs manual offer from BZ)
  16. melvin-bot commented on Mar 29, 2024

    @melvin-bot

    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:

    • [@DylanDylann] The PR that introduced the bug has been identified. Link to the PR:
    • [@DylanDylann] 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:
    • [@DylanDylann] 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:
    • [@DylanDylann] Determine if we should create a regression test for this bug.
    • [@DylanDylann] 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.
    • [@alexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  17. alexpensify commented on Apr 4, 2024

    @alexpensify
    Contributor

    @DylanDylann and @tienifr - I had to create a new Job in Upwork:

    https://www.upwork.com/jobs/~019a5f69e7fb9d4402

    Please apply and I can complete the payment process tomorrow. Thanks!

  18. melvin-bot commented on Apr 5, 2024

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@alexpensify)

    • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1754884327412707328/hired)
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  19. alexpensify commented on Apr 5, 2024

    @alexpensify
    Contributor

    @tienifr and @DylanDylann - I've sent offers in Upwork. Please accept and I can continue the process. Thanks!

  20. alexpensify commented on Apr 8, 2024

    @alexpensify
    Contributor

    I was able to complete the payment process for @tienifr. I'm waiting for @DylanDylann to accept and I can carry on in Upwork.

  21. DylanDylann commented on Apr 9, 2024

    @DylanDylann
    Contributor

    @alexpensify I accepted. Thanks

  22. alexpensify commented on Apr 9, 2024

    @alexpensify
    Contributor

    Thanks, all set here. Everyone has been paid in Upwork. Here is the payment summary:

    #34189 (comment)

    Upwork Link:

    https://www.upwork.com/jobs/~019a5f69e7fb9d4402

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.EngineeringExternalAdded to denote the issue can be worked on by a contributorWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions